Class: OoxmlParser::DocxShapeSize
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::DocxShapeSize
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb
Instance Attribute Summary collapse
-
#child_extent ⇒ Object
Returns the value of attribute child_extent.
-
#child_offset ⇒ Object
Returns the value of attribute child_offset.
-
#extent ⇒ Object
(also: #extents)
Returns the value of attribute extent.
-
#flip_horizontal ⇒ Object
Returns the value of attribute flip_horizontal.
-
#flip_vertical ⇒ Object
Returns the value of attribute flip_vertical.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#rotation ⇒ Object
Returns the value of attribute rotation.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ DocxShapeSize
Parse DocxShapeSize object.
Methods inherited from OOXMLDocumentObject
#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, #initialize, unzip_file, #with_data?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#child_extent ⇒ Object
Returns the value of attribute child_extent.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb', line 6 def child_extent @child_extent end |
#child_offset ⇒ Object
Returns the value of attribute child_offset.
5 6 7 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb', line 5 def child_offset @child_offset end |
#extent ⇒ Object Also known as: extents
Returns the value of attribute extent.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb', line 4 def extent @extent end |
#flip_horizontal ⇒ Object
Returns the value of attribute flip_horizontal.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb', line 4 def flip_horizontal @flip_horizontal end |
#flip_vertical ⇒ Object
Returns the value of attribute flip_vertical.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb', line 4 def flip_vertical @flip_vertical end |
#offset ⇒ Object
Returns the value of attribute offset.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb', line 4 def offset @offset end |
#rotation ⇒ Object
Returns the value of attribute rotation.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb', line 4 def rotation @rotation end |
Instance Method Details
#parse(node) ⇒ DocxShapeSize
Parse DocxShapeSize object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb', line 13 def parse(node) node.attributes.each do |key, value| case key when 'rot' @rotation = value.value.to_f when 'flipH' @flip_horizontal = value.value.to_f when 'flipV' @flip_vertical = value.value.to_f end end node.xpath('*').each do |node_child| case node_child.name when 'off' @offset = OOXMLCoordinates.parse(node_child, unit: :emu) when 'ext' @extent = OOXMLCoordinates.parse(node_child, x_attr: 'cx', y_attr: 'cy', unit: :emu) when 'chOff' @child_offset = OOXMLCoordinates.parse(node_child, unit: :emu) when 'chExt' @child_extent = OOXMLCoordinates.parse(node_child, x_attr: 'cx', y_attr: 'cy', unit: :emu) end end self end |