Module StateMachine::Integrations::Base::ClassMethods
In: lib/state_machine/integrations/base.rb

Methods

extended   version   versions  

Attributes

defaults  [R]  The default options to use for state machines using this integration

Public Instance methods

Extends the given object with any version overrides that are currently active

Creates a new version override for an integration. When this integration is activated, each version that is marked as active will also extend the integration.

Example

  module StateMachine
    module Integrations
      module ORMLibrary
        version '0.2.x - 0.3.x' do
          def self.active?
            ::ORMLibrary::VERSION >= '0.2.0' && ::ORMLibrary::VERSION < '0.4.0'
          end

          def invalidate(object, attribute, message, values = [])
            # Override here...
          end
        end
      end
    end
  end

In the above example, a version override is defined for the ORMLibrary integration when the version is between 0.2.x and 0.3.x.

Tracks the various version overrides for an integration

[Validate]