Class: Stateflow::Machine

Inherits:
Object
  • Object
show all
Defined in:
lib/stateflow/machine.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&machine) ⇒ Machine

Returns a new instance of Machine.



5
6
7
8
# File 'lib/stateflow/machine.rb', line 5

def initialize(&machine)
  @states, @events = Hash.new, Hash.new
  instance_eval(&machine)
end

Instance Attribute Details

#eventsObject

Returns the value of attribute events.



3
4
5
# File 'lib/stateflow/machine.rb', line 3

def events
  @events
end

#initial_stateObject

Returns the value of attribute initial_state.



3
4
5
# File 'lib/stateflow/machine.rb', line 3

def initial_state
  @initial_state
end

#statesObject

Returns the value of attribute states.



3
4
5
# File 'lib/stateflow/machine.rb', line 3

def states
  @states
end

Instance Method Details

#state_column(name = :state) ⇒ Object



10
11
12
# File 'lib/stateflow/machine.rb', line 10

def state_column(name = :state)
  @state_column ||= name
end