Class: Yasm::Context::StateContainer

Inherits:
Object
  • Object
show all
Defined in:
lib/yasm/context/state_container.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ StateContainer

Returns a new instance of StateContainer.



7
8
9
10
11
# File 'lib/yasm/context/state_container.rb', line 7

def initialize(options)
  @context = options[:context]
  @state   = options[:state]
  @name    = options[:name]
end

Instance Attribute Details

#contextObject

Returns the value of attribute context.



4
5
6
# File 'lib/yasm/context/state_container.rb', line 4

def context
  @context
end

#stateObject

:nodoc:



5
6
7
# File 'lib/yasm/context/state_container.rb', line 5

def state
  @state
end

Instance Method Details

#do!(*actions) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/yasm/context/state_container.rb', line 28

def do!(*actions)
  actions.each do |action|
    run_before_action_hooks action
    fire! action
    run_after_action_hooks action
  end
end

#valueObject



13
# File 'lib/yasm/context/state_container.rb', line 13

def value; state; end