Class: DataMapper::Is::StateMachine::Data::Event
- Inherits:
-
Object
- Object
- DataMapper::Is::StateMachine::Data::Event
- Defined in:
- lib/dm-is-state_machine/is/data/event.rb
Instance Attribute Summary collapse
-
#machine ⇒ Object
readonly
Returns the value of attribute machine.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#transitions ⇒ Object
readonly
Returns the value of attribute transitions.
Instance Method Summary collapse
- #add_transition(from, to) ⇒ Object
-
#initialize(name, machine) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(name, machine) ⇒ Event
Returns a new instance of Event.
10 11 12 13 14 |
# File 'lib/dm-is-state_machine/is/data/event.rb', line 10 def initialize(name, machine) @name = name @machine = machine @transitions = [] end |
Instance Attribute Details
#machine ⇒ Object (readonly)
Returns the value of attribute machine.
8 9 10 |
# File 'lib/dm-is-state_machine/is/data/event.rb', line 8 def machine @machine end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/dm-is-state_machine/is/data/event.rb', line 8 def name @name end |
#transitions ⇒ Object (readonly)
Returns the value of attribute transitions.
8 9 10 |
# File 'lib/dm-is-state_machine/is/data/event.rb', line 8 def transitions @transitions end |
Instance Method Details
#add_transition(from, to) ⇒ Object
16 17 18 |
# File 'lib/dm-is-state_machine/is/data/event.rb', line 16 def add_transition(from, to) @transitions << { :from => from, :to => to } end |