Class: DataMapper::Is::StateMachine::Data::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/dm-is-state_machine/is/data/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#machineObject (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

#nameObject (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

#transitionsObject (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