Method: StateMachine::NodeCollection#at

Defined in:
lib/state_machine/node_collection.rb

#at(index) ⇒ Object

Gets the node at the given index.

states = StateMachine::NodeCollection.new
states << StateMachine::State.new(machine, :parked)
states << StateMachine::State.new(machine, :idling)

states.at(0).name    # => :parked
states.at(1).name    # => :idling


131
132
133
# File 'lib/state_machine/node_collection.rb', line 131

def at(index)
  @nodes[index]
end