Sha256: 692a6c309ae3707a58cf44c7650232cbb293000cb033270d8bf9d44199f02448

Contents?: true

Size: 295 Bytes

Versions: 2

Compression:

Stored size: 295 Bytes

Contents

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

    def available_events
      @state_machine.events.keys.sort
    end

    def available_transitions
      @state_machine.events_for(current_state)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
transitions-1.0.0 lib/transitions/presenter.rb
transitions-0.2.1 lib/transitions/presenter.rb