Class: Mocha::StateMachine::StatePredicate

Inherits:
Object
  • Object
show all
Defined in:
lib/mocha/state_machine.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(state_machine, state) ⇒ StatePredicate

Returns a new instance of StatePredicate.



29
30
31
# File 'lib/mocha/state_machine.rb', line 29

def initialize(state_machine, state)
  @state_machine, @state = state_machine, state
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/mocha/state_machine.rb', line 33

def active?
  @state_machine.current_state != @state
end

#mocha_inspectObject



37
38
39
# File 'lib/mocha/state_machine.rb', line 37

def mocha_inspect
  "#{@state_machine.name} is not #{@state.mocha_inspect}"
end