Class: Mocha::StateMachine::State
Overview
:nodoc:
Instance Method Summary collapse
- #activate ⇒ Object
- #active? ⇒ Boolean
-
#initialize(state_machine, state) ⇒ State
constructor
A new instance of State.
- #mocha_inspect ⇒ Object
Constructor Details
#initialize(state_machine, state) ⇒ State
Returns a new instance of State.
9 10 11 |
# File 'lib/mocha/state_machine.rb', line 9 def initialize(state_machine, state) @state_machine, @state = state_machine, state end |
Instance Method Details
#activate ⇒ Object
13 14 15 |
# File 'lib/mocha/state_machine.rb', line 13 def activate @state_machine.current_state = @state end |
#active? ⇒ Boolean
17 18 19 |
# File 'lib/mocha/state_machine.rb', line 17 def active? @state_machine.current_state == @state end |
#mocha_inspect ⇒ Object
21 22 23 |
# File 'lib/mocha/state_machine.rb', line 21 def mocha_inspect "#{@state_machine.name} is #{@state.mocha_inspect}" end |