Method: Arbre::Context#initialize
- Defined in:
- lib/arbre/context.rb
#initialize(assigns = nil, helpers = nil, &block) ⇒ Context
Initialize a new Arbre::Context. Any passed block will be instance-exec’d.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/arbre/context.rb', line 23 def initialize(assigns = nil, helpers = nil, &block) @_assigns = (assigns || {}).symbolize_keys @_helpers = helpers @_element_stack = [ self ] @_flow_stack = [ :append ] # Pass ourselves as the arbre context to the element. super self instance_exec &block if block_given? end |