lib/finite_machine/dsl.rb in finite_machine-0.12.1 vs lib/finite_machine/dsl.rb in finite_machine-0.13.0

- old
+ new

@@ -8,11 +8,11 @@ # A generic DSL for describing the state machine class GenericDSL # Initialize a generic DSL # # @api public - def initialize(machine, **attrs) + def initialize(machine, attrs) @machine = machine @attrs = attrs end # Expose any state constant @@ -51,11 +51,11 @@ include Safety # Initialize top level DSL # # @api public - def initialize(machine, **attrs) + def initialize(machine, attrs) super(machine, attrs) @machine.state = FiniteMachine::DEFAULT_STATE @defer_initial = true @silent_initial = true @@ -94,11 +94,11 @@ # @param [String, Hash] value # # @return [StateMachine] # # @api public - def initial(value, **options) + def initial(value, options = {}) state = (value && !value.is_a?(Hash)) ? value : raise_missing_state name, @defer_initial, @silent_initial = *parse_initial(options) @initial_event = name event(name, FiniteMachine::DEFAULT_STATE => state, silent: @silent_initial) end @@ -120,10 +120,10 @@ # # @return [FiniteMachine::StateMachine] # # @api public def terminal(*values) - self.final_state = values + self.terminal_states = values end # Create event and associate transition # # @example