Module: StateMachina::ExtendedIntegration::ClassMethods

Defined in:
lib/state_machina/extended_integration.rb

Instance Method Summary collapse

Instance Method Details

#extend_machine(klass, machine_name = 'default') {|StateMachina::Registry.find_machine!(model_name, machine_name)| ... } ⇒ Object Also known as: extend_state_machine

Extends a machine on a model where the machine is already defined

Yields:



5
6
7
8
9
# File 'lib/state_machina/extended_integration.rb', line 5

def extend_machine(klass, machine_name = 'default')
  model_name = StateMachina::Util.normalized_klass_to_name(klass)

  yield(StateMachina::Registry.find_machine!(model_name, machine_name))
end