Class: Amrita2::Core::ParentNode
- Defined in:
- lib/amrita2/template.rb
Overview
:nodoc: all
Direct Known Subclasses
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#element ⇒ Object
readonly
Returns the value of attribute element.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #dynamic? ⇒ Boolean
- #each(&block) ⇒ Object
- #has_dynamic? ⇒ Boolean
- #has_ruby? ⇒ Boolean
-
#initialize(parent, element) ⇒ ParentNode
constructor
A new instance of ParentNode.
- #module_src(cg) ⇒ Object
Methods inherited from BaseNode
Constructor Details
#initialize(parent, element) ⇒ ParentNode
Returns a new instance of ParentNode.
731 732 733 734 735 |
# File 'lib/amrita2/template.rb', line 731 def initialize(parent, element) super(parent) @element = element @children = parent_de.parse_element(@element) end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
730 731 732 |
# File 'lib/amrita2/template.rb', line 730 def children @children end |
#element ⇒ Object (readonly)
Returns the value of attribute element.
730 731 732 |
# File 'lib/amrita2/template.rb', line 730 def element @element end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
730 731 732 |
# File 'lib/amrita2/template.rb', line 730 def parent @parent end |
Instance Method Details
#dynamic? ⇒ Boolean
737 738 739 |
# File 'lib/amrita2/template.rb', line 737 def dynamic? children.any? { |c| c.dynamic? } end |
#each(&block) ⇒ Object
749 750 751 |
# File 'lib/amrita2/template.rb', line 749 def each(&block) children.each(&block) end |
#has_dynamic? ⇒ Boolean
741 742 743 |
# File 'lib/amrita2/template.rb', line 741 def has_dynamic? children.any? { |c| c.dynamic? } end |
#has_ruby? ⇒ Boolean
745 746 747 |
# File 'lib/amrita2/template.rb', line 745 def has_ruby? children.any? { |c| c.has_ruby? } end |
#module_src(cg) ⇒ Object
753 754 755 756 757 |
# File 'lib/amrita2/template.rb', line 753 def module_src(cg) each do |c| c.module_src(cg) end end |