Module: Transitions::Presenter

Included in:
Transitions
Defined in:
lib/transitions/presenter.rb

Instance Method Summary collapse

Instance Method Details

#available_eventsObject


7
8
9
# File 'lib/transitions/presenter.rb', line 7

def available_events
  @state_machine.events.keys.sort
end

#available_statesObject


3
4
5
# File 'lib/transitions/presenter.rb', line 3

def available_states
  @state_machine.states.map(&:name).sort_by(&:to_s)
end

#available_transitionsObject


11
12
13
# File 'lib/transitions/presenter.rb', line 11

def available_transitions
  @state_machine.events_for(current_state)
end