Parent

Class/Module Index [+]

Quicksearch

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 11
def initialize(state_machine, state)
  @state_machine, @state = state_machine, state
end

Public Instance Methods

activate() click to toggle source

@private

# File lib/mocha/state_machine.rb, line 16
def activate
  @state_machine.current_state = @state
end
active?() click to toggle source

@private

# File lib/mocha/state_machine.rb, line 21
def active?
  @state_machine.current_state == @state
end
mocha_inspect() click to toggle source

@private

# File lib/mocha/state_machine.rb, line 26
def mocha_inspect
  "#{@state_machine.name} is #{@state.mocha_inspect}"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.