Class: Amrita2::Core::ParentNode

Inherits:
BaseNode show all
Defined in:
lib/amrita2/template.rb

Overview

:nodoc: all

Direct Known Subclasses

CompoundElement, DynamicElement

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseNode

#parent_de, #render_me, #root

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

#childrenObject (readonly)

Returns the value of attribute children.



730
731
732
# File 'lib/amrita2/template.rb', line 730

def children
  @children
end

#elementObject (readonly)

Returns the value of attribute element.



730
731
732
# File 'lib/amrita2/template.rb', line 730

def element
  @element
end

#parentObject (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

Returns:

  • (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

Returns:

  • (Boolean)


741
742
743
# File 'lib/amrita2/template.rb', line 741

def has_dynamic?
  children.any? { |c| c.dynamic? }
end

#has_ruby?Boolean

Returns:

  • (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