Class: OoxmlParser::OldDocxGroup
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::OldDocxGroup
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb
Overview
Fallback DOCX group data
Instance Attribute Summary collapse
-
#elements ⇒ Object
Returns the value of attribute elements.
-
#properties ⇒ Object
Returns the value of attribute properties.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(properties = OldDocxGroupProperties.new, parent: nil) ⇒ OldDocxGroup
constructor
A new instance of OldDocxGroup.
-
#parse(node) ⇒ OldDocxGroup
Parse OldDocxGroup object.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(properties = OldDocxGroupProperties.new, parent: nil) ⇒ OldDocxGroup
Returns a new instance of OldDocxGroup.
10 11 12 13 14 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb', line 10 def initialize(properties = OldDocxGroupProperties.new, parent: nil) @properties = properties @elements = [] super(parent: parent) end |
Instance Attribute Details
#elements ⇒ Object
Returns the value of attribute elements.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb', line 8 def elements @elements end |
#properties ⇒ Object
Returns the value of attribute properties.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb', line 8 def properties @properties end |
Instance Method Details
#parse(node) ⇒ OldDocxGroup
Parse OldDocxGroup object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb', line 19 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'shape' element = OldDocxGroupElement.new(:shape) element.object = OldDocxShape.new(parent: self).parse(node_child) @elements << element when 'wrap' @properties.wrap = node_child.attribute('type').value.to_sym unless node_child.attribute('type').nil? when 'group' @elements << OldDocxGroup.new(parent: self).parse(node_child) end end self end |