def state(name, opts={}, &block)
      @states.delete_if { |s| s.name == name }

      action = opts ? opts[:action] : nil
      @states << State.new(name, action, &block)
    end
def state(name, opts={}, &block)
      @states.delete_if { |s| s.name == name }

      action = opts ? opts[:action] : nil
      @states << State.new(name, action, &block)
    end
Sets up a new instance of Stately::Machine
 Define a new Stately::State and add it to this Stately::Machine.

 @param [String] name The name of the state. This is also stored in the instance object's
   state attribute.
 @param [Hash] opts Optionally, a method name can be defined as this state's action, if it
   can't be inferred from the name.