Class: OpenXml::Docx::Elements::Container

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

Direct Known Subclasses

Background, BidiEmbed, BidiOverride, CompatibilitySetting, CompatibilitySettings, Drawing, Font, GroupShape, MarkupCompatibilityAlternateContent, MarkupCompatibilityChoice, MarkupCompatibilityFallback, Paragraph, Ruby, Run, SectionProperties, Table, TableCell, TableGrid, TableRow, TextboxContent, VmlContainer, WordProcessingDrawingAnchor, WordProcessingDrawingInline, WordProcessingDrawingNvGraphicFrameProperties, WordProcessingDrawingPositionH, WordProcessingDrawingPositionV, WordProcessingDrawingWrapPolygon, WordProcessingDrawingWrapThrough, WordProcessingDrawingWrapTight, WordProcessingGroupsGroupShapeProperties, WordProcessingGroupsNvShapeDrawingProperties, WordProcessingShapesBodyProperties, WordProcessingShapesNvDrawingProperties, WordProcessingShapesShape, WordProcessingShapesShapeProperties, WordProcessingShapesTextualContent, WordprocessingShapeGroup, OpenXml::DrawingML::Elements::AdjustValuesList, OpenXml::DrawingML::Elements::Blip, OpenXml::DrawingML::Elements::BlipFill, OpenXml::DrawingML::Elements::ExtensionList, OpenXml::DrawingML::Elements::Graphic, OpenXml::DrawingML::Elements::GraphicData, OpenXml::DrawingML::Elements::NonVisualPictureDrawingProperties, OpenXml::DrawingML::Elements::NonVisualPictureProperties, OpenXml::DrawingML::Elements::NonVisualShapeDrawingProperties, OpenXml::DrawingML::Elements::Outline, OpenXml::DrawingML::Elements::Picture, OpenXml::DrawingML::Elements::PictureShapeProperties, OpenXml::DrawingML::Elements::PresetGeometry, OpenXml::DrawingML::Elements::PresetTextWarp, OpenXml::DrawingML::Elements::SolidFill, OpenXml::DrawingML::Elements::Stretch, OpenXml::DrawingML::Elements::TransformEffect, Vml::Elements::Group, Vml::Elements::Rectangle, Vml::Elements::RoundedRectangle

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, #property_xml

Methods inherited from Element

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

Methods included from AttributeBuilder

#attributes, included, #render?

Constructor Details

#initializeContainer

Returns a new instance of Container.



9
10
11
# File 'lib/openxml/docx/elements/container.rb', line 9

def initialize
  @children = []
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



7
8
9
# File 'lib/openxml/docx/elements/container.rb', line 7

def children
  @children
end

Instance Method Details

#<<(child) ⇒ Object



13
14
15
# File 'lib/openxml/docx/elements/container.rb', line 13

def <<(child)
  children << child
end

#to_xml(xml) ⇒ Object



17
18
19
20
21
22
# File 'lib/openxml/docx/elements/container.rb', line 17

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