Class: Mocha::StateMachine::StatePredicate
- Defined in:
- lib/mocha/state_machine.rb
Overview
:nodoc:
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#initialize(state_machine, state) ⇒ StatePredicate
constructor
A new instance of StatePredicate.
- #mocha_inspect ⇒ Object
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
33 34 35 |
# File 'lib/mocha/state_machine.rb', line 33 def active? @state_machine.current_state != @state end |
#mocha_inspect ⇒ Object
37 38 39 |
# File 'lib/mocha/state_machine.rb', line 37 def mocha_inspect "#{@state_machine.name} is not #{@state.mocha_inspect}" end |