class Mocha::StateMachine::StatePredicate

Provides the ability to determine whether a {StateMachine} is in a specified state at some point in the future.

Public Class Methods

new(state_machine, state, description, &active_check) click to toggle source

@private

# File lib/mocha/state_machine.rb, line 8
def initialize(state_machine, state, description, &active_check)
  @state_machine = state_machine
  @state = state
  @description = description
  @active_check = active_check
end

Public Instance Methods

active?() click to toggle source

@private

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

@private

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