Class: FiniteMachine::StateDefinition Private

Inherits:
Object
  • Object
show all
Defined in:
lib/finite_machine/state_definition.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A class responsible for defining state query methods on state machine

Used by TranstionBuilder to add state query definition to the StateMachine instance.

Instance Method Summary collapse

Constructor Details

#initialize(machine) ⇒ StateDefinition

Initialize a StateDefinition

Parameters:



16
17
18
# File 'lib/finite_machine/state_definition.rb', line 16

def initialize(machine)
  @machine = machine
end

Instance Method Details

#apply(states) ⇒ nil

Define query methods for states

Parameters:

  • states (Hash)

    the states that require query helpers

Returns:

  • (nil)


28
29
30
# File 'lib/finite_machine/state_definition.rb', line 28

def apply(states)
  define_state_query_methods(states)
end