### Home Classes Methods

### In Files

- lib/state_machine/integrations/active_model/observer_update.rb

### Parent

Object

### Methods

- #args
- #class

### Files

- LICENSE

### Class/Module Index

Quicksearch

- StateMachine
- StateMachine::AllMatcher
- StateMachine::Assertions
- StateMachine::AttributeTransitionCollection
- StateMachine::BlacklistMatcher
- StateMachine::Branch
- StateMachine::Callback
- StateMachine::ClassMethods
- StateMachine::Error
- StateMachine::EvalHelpers
- StateMachine::Event
- StateMachine::EventCollection
- StateMachine::Graph
- StateMachine::InstanceMethods
- StateMachine::IntegrationNotFound
- StateMachine::Integrations
- StateMachine::Integrations::ActiveModel
- StateMachine::Integrations::ActiveModel::Observer
- StateMachine::Integrations::ActiveModel::ObserverUpdate
- StateMachine::Integrations::ActiveRecord
- StateMachine::Integrations::Base
- StateMachine::Integrations::Base::ClassMethods
- StateMachine::Integrations::DataMapper
- StateMachine::Integrations::DataMapper::Observer
- StateMachine::Integrations::MongoMapper
- StateMachine::Integrations::Mongoid
- StateMachine::Integrations::Sequel
- StateMachine::InvalidEvent
- StateMachine::InvalidParallelTransition
- StateMachine::InvalidTransition
- StateMachine::LoopbackMatcher
- StateMachine::Machine
- StateMachine::MachineCollection
- StateMachine::MacroMethods
- StateMachine::Matcher
- StateMachine::MatcherHelpers
- StateMachine::NodeCollection
- StateMachine::Path
- StateMachine::PathCollection
- StateMachine::RailsEngine
- StateMachine::State
- StateMachine::StateCollection
- StateMachine::StateContext
- StateMachine::Transition
- StateMachine::TransitionCollection
- StateMachine::WhitelistMatcher
- StateMachine::YARD
- StateMachine::YARD::Handlers
- StateMachine::YARD::Handlers::Base
- StateMachine::YARD::Handlers::Event
- StateMachine::YARD::Handlers::Machine
- StateMachine::YARD::Handlers::State
- StateMachine::YARD::Handlers::Transition
- Object

No matching classes.

# StateMachine::Integrations::ActiveModel::ObserverUpdate

Represents the encapsulation of all of the details to be included in an update to state machine observers. This allows multiple arguments to get passed to an observer method (instead of just a single `object`) while still respecting the way in which ActiveModel checks for the object's list of observers.

### Attributes

method[R]

The method to invoke on the observer

object[R]

The object being transitioned

transition[R]

The transition being run

### Public Instance Methods

args() click to toggle source

The arguments to pass into the method

    # File lib/state_machine/integrations/active_model/observer_update.rb, line 24
    def args
      [object, transition]
    end

class() click to toggle source

The class of the object being transitioned. Normally the object getting passed into observer methods is the actual instance of the ActiveModel class. ActiveModel uses that instance's class to check for enabled / disabled observers.

Since state_machine is passing an ObserverUpdate instance into observer methods, `class` needs to be overridden so that ActiveModel can still get access to the enabled / disabled observers.

    # File lib/state_machine/integrations/active_model/observer_update.rb, line 36
    def class
      object.class
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.