Class: Amrita2::Expander::Base
- Includes:
- Runtime
- Defined in:
- lib/amrita2/core.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#mod ⇒ Object
readonly
Returns the value of attribute mod.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
Instance Method Summary collapse
- #call_template_method(data = nil, context_data = data, attrs = nil, &block) ⇒ Object
-
#initialize(parent, spec, pmod) ⇒ Base
constructor
A new instance of Base.
Methods included from Runtime
#context_stack, #current_context, #end_tag, #get_binding, #get_context_data, #get_mainstream, #get_substream, #new_binding, #new_context, #new_context_data, #new_element, #output_substream, #set_binding, #set_context_data, #start_tag
Constructor Details
#initialize(parent, spec, pmod) ⇒ Base
Returns a new instance of Base.
1357 1358 1359 1360 1361 1362 1363 |
# File 'lib/amrita2/core.rb', line 1357 def initialize(parent, spec, pmod) @parent = parent @spec = spec @children = [] @name = @spec.sym @method = pmod.method(@spec.sym || :expand_template) unless spec.option[:dummy_element] end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
1356 1357 1358 |
# File 'lib/amrita2/core.rb', line 1356 def children @children end |
#mod ⇒ Object (readonly)
Returns the value of attribute mod.
1356 1357 1358 |
# File 'lib/amrita2/core.rb', line 1356 def mod @mod end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
1356 1357 1358 |
# File 'lib/amrita2/core.rb', line 1356 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
1356 1357 1358 |
# File 'lib/amrita2/core.rb', line 1356 def parent @parent end |
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
1356 1357 1358 |
# File 'lib/amrita2/core.rb', line 1356 def spec @spec end |
Instance Method Details
#call_template_method(data = nil, context_data = data, attrs = nil, &block) ⇒ Object
1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 |
# File 'lib/amrita2/core.rb', line 1365 def call_template_method(data=nil, context_data=data, attrs=nil, &block) args = [data] args << attrs if attrs if @spec.option[:eval_cdata_as_erb] and context_data new_context_data(context_data) do @method.call(*args, &block) end else @method.call(*args, &block) end end |