Class: Rocx::Elements::Container
- Includes:
- PropertyBuilder
- Defined in:
- lib/rocx/elements/container.rb
Direct Known Subclasses
Constant Summary
Constants included from AttributeBuilder
AttributeBuilder::VALID_THEME_COLORS, AttributeBuilder::VALID_TYPES
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
Instance Method Summary collapse
- #<<(child) ⇒ Object
-
#initialize ⇒ Container
constructor
A new instance of Container.
- #to_xml(xml) ⇒ Object
Methods included from PropertyBuilder
Methods inherited from Element
#name, name, namespace, #namespace, #tag, tag
Methods included from AttributeBuilder
#attributes, included, #render?
Constructor Details
#initialize ⇒ Container
Returns a new instance of Container.
8 9 10 |
# File 'lib/rocx/elements/container.rb', line 8 def initialize @children = [] end |
Instance Attribute Details
#children ⇒ Object (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 |