Class: Mocha::StateMachine::StatePredicate
- Defined in:
- lib/mocha/state_machine.rb
Overview
Provides the ability to determine whether a Mocha::StateMachine is in a specified state at some point in the future.
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.
36 37 38 |
# File 'lib/mocha/state_machine.rb', line 36 def initialize(state_machine, state) @state_machine, @state = state_machine, state end |
Instance Method Details
#active? ⇒ Boolean
41 42 43 |
# File 'lib/mocha/state_machine.rb', line 41 def active? @state_machine.current_state != @state end |
#mocha_inspect ⇒ Object
46 47 48 |
# File 'lib/mocha/state_machine.rb', line 46 def mocha_inspect "#{@state_machine.name} is not #{@state.mocha_inspect}" end |