Class: Yasm::Context::StateContainer
- Inherits:
-
Object
- Object
- Yasm::Context::StateContainer
- Defined in:
- lib/yasm/context/state_container.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#state ⇒ Object
:nodoc:.
Instance Method Summary collapse
- #do!(*actions) ⇒ Object
-
#initialize(options) ⇒ StateContainer
constructor
A new instance of StateContainer.
- #value ⇒ Object
Constructor Details
#initialize(options) ⇒ StateContainer
Returns a new instance of StateContainer.
7 8 9 10 |
# File 'lib/yasm/context/state_container.rb', line 7 def initialize() @context = [:context] @state = [:state] end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
4 5 6 |
# File 'lib/yasm/context/state_container.rb', line 4 def context @context end |
#state ⇒ Object
:nodoc:
5 6 7 |
# File 'lib/yasm/context/state_container.rb', line 5 def state @state end |
Instance Method Details
#do!(*actions) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/yasm/context/state_container.rb', line 22 def do!(*actions) actions = [self.state.class.maximum_duration_action] + actions if self.state.passed_maximum_time_limit? Yasm::Manager.execute( :context => context, :state_container => self, :actions => actions ) end |
#value ⇒ Object
12 |
# File 'lib/yasm/context/state_container.rb', line 12 def value; @state; end |