module Listen::FSM::ClassMethods

def start_state(new_start_state = nil)

Passing a state name sets the start state
Obtain or set the start state
def start_state(new_start_state = nil)
  if new_start_state
    new_start_state.is_a?(Symbol) or raise ArgumentError, "state name must be a Symbol (got #{new_start_state.inspect})"
    @start_state = new_start_state
  else
    defined?(@start_state) or raise ArgumentError, "`start_state :<state>` must be declared before `new`"
    @start_state
  end
end

def state(state_name, to: nil, &block)

* to: a state or array of states this state can transition to
Options:
Declare an FSM state and optionally provide a callback block to fire on state entry
def state(state_name, to: nil, &block)
  state_name.is_a?(Symbol) or raise ArgumentError, "state name must be a Symbol (got #{state_name.inspect})"
  states[state_name] = State.new(state_name, to, &block)
end

def states

The valid states for this FSM, as a hash with state name symbols as keys and State objects as values.
def states
  @states ||= {}
end