Class: Rocx::Elements::Container

Inherits:
Element
  • Object
show all
Includes:
PropertyBuilder
Defined in:
lib/rocx/elements/container.rb

Direct Known Subclasses

BidiEmbed, BidiOverride, Paragraph, Ruby, Run

Constant Summary

Constants included from AttributeBuilder

AttributeBuilder::VALID_THEME_COLORS, AttributeBuilder::VALID_TYPES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PropertyBuilder

included

Methods inherited from Element

#name, name, namespace, #namespace, #tag, tag

Methods included from AttributeBuilder

#attributes, included, #render?

Constructor Details

#initializeContainer

Returns a new instance of Container.



8
9
10
# File 'lib/rocx/elements/container.rb', line 8

def initialize
  @children = []
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



6
7
8
# File 'lib/rocx/elements/container.rb', line 6

def children
  @children
end

Instance Method Details

#<<(child) ⇒ Object



12
13
14
# File 'lib/rocx/elements/container.rb', line 12

def <<(child)
  children << child
end

#to_xml(xml) ⇒ Object



16
17
18
19
20
21
# File 'lib/rocx/elements/container.rb', line 16

def to_xml(xml)
  xml[namespace].public_send(tag, xml_attributes) {
    property_xml(xml)
    children.each { |child| child.to_xml(xml) }
  }
end