class Mocha::StateMachine::State
Provides a mechanism to change the state of a {StateMachine} at some point in the future.
Public Class Methods
new(state_machine, state)
click to toggle source
@private
# File lib/mocha/state_machine.rb, line 8 def initialize(state_machine, state) @state_machine = state_machine @state = state end
Public Instance Methods
activate()
click to toggle source
@private
# File lib/mocha/state_machine.rb, line 14 def activate @state_machine.current_state = @state end
active?()
click to toggle source
@private
# File lib/mocha/state_machine.rb, line 19 def active? @state_machine.current_state == @state end
mocha_inspect()
click to toggle source
@private
# File lib/mocha/state_machine.rb, line 24 def mocha_inspect "#{@state_machine.name} is #{@state.mocha_inspect}" end