Module: Moory::Afferent
Instance Attribute Summary collapse
-
#state ⇒ Object
Returns the value of attribute state.
-
#transitions ⇒ Object
Returns the value of attribute transitions.
Instance Method Summary collapse
Instance Attribute Details
#state ⇒ Object
Returns the value of attribute state.
6 7 8 |
# File 'lib/moory/machine.rb', line 6 def state @state end |
#transitions ⇒ Object
Returns the value of attribute transitions.
5 6 7 |
# File 'lib/moory/machine.rb', line 5 def transitions @transitions end |
Instance Method Details
#awaits ⇒ Object
22 23 24 |
# File 'lib/moory/machine.rb', line 22 def awaits transitions.egresses(state:state) end |
#issue(stimulus) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/moory/machine.rb', line 15 def issue(stimulus) if response = transitions.response(origin: state, stimulus: stimulus) honour(response) state end end |
#understand?(stimulus) ⇒ Boolean
26 27 28 |
# File 'lib/moory/machine.rb', line 26 def understand?(stimulus) awaits.include?(stimulus) end |