Module: OpenXml::Docx::HasProperties
- Included in:
- Elements::AbstractNumbering, Elements::Background, Elements::BidiEmbed, Elements::BidiOverride, Elements::CompatibilitySetting, Elements::CompatibilitySettings, Elements::Drawing, Elements::Font, Elements::GroupShape, Elements::Level, Elements::LevelOverride, Elements::MarkupCompatibilityAlternateContent, Elements::MarkupCompatibilityChoice, Elements::MarkupCompatibilityFallback, Elements::Numbering, Elements::Paragraph, Elements::Ruby, Elements::Run, Elements::SectionProperties, Elements::Table, Elements::TableCell, Elements::TableGrid, Elements::TableRow, Elements::TextboxContent, Elements::VmlContainer, Elements::WordProcessingDrawingAnchor, Elements::WordProcessingDrawingInline, Elements::WordProcessingDrawingNvGraphicFrameProperties, Elements::WordProcessingDrawingPositionH, Elements::WordProcessingDrawingPositionV, Elements::WordProcessingDrawingWrapPolygon, Elements::WordProcessingDrawingWrapThrough, Elements::WordProcessingDrawingWrapTight, Elements::WordProcessingGroupsGroupShapeProperties, Elements::WordProcessingGroupsNvShapeDrawingProperties, Elements::WordProcessingShapesBodyProperties, Elements::WordProcessingShapesNvDrawingProperties, Elements::WordProcessingShapesShape, Elements::WordProcessingShapesShapeProperties, Elements::WordProcessingShapesTextualContent, Section, Style
- Defined in:
- lib/openxml/docx/has_properties.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
5 6 7 |
# File 'lib/openxml/docx/has_properties.rb', line 5 def self.included(base) base.extend ClassMethods end |
Instance Method Details
#property_xml(xml) ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/openxml/docx/has_properties.rb', line 60 def property_xml(xml) props = properties.keys.map(&method(:send)).compact return if props.none?(&:render?) xml[namespace].public_send(properties_tag) { props.each { |prop| prop.to_xml(xml) } } end |
#to_xml(xml) ⇒ Object
53 54 55 56 57 58 |
# File 'lib/openxml/docx/has_properties.rb', line 53 def to_xml(xml) super(xml) do property_xml(xml) yield xml if block_given? end end |