Class: OoxmlParser::DocxDrawingProperties
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::DocxDrawingProperties
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb
Overview
Docx Drawing Properties
Instance Attribute Summary collapse
-
#distance_from_text ⇒ DocxDrawingDistanceFromText
readonly
Distance from text.
-
#horizontal_position ⇒ DocxDrawingPosition
readonly
Horizontal position.
-
#object_size ⇒ OOXMLCoordinates
readonly
Size of object.
-
#relative_height ⇒ Integer
readonly
Relative height of object.
-
#simple_position ⇒ OOXMLCoordinates
readonly
Simple position of object.
-
#size_relative_horizontal ⇒ SizeRelativeHorizontal
readonly
Size of drawing relative to horizontal.
-
#size_relative_vertical ⇒ SizeRelativeVertical
readonly
Size of drawing relative to vertical.
-
#vertical_position ⇒ DocxDrawingPosition
readonly
Vertical position.
-
#wrap ⇒ DocxWrapDrawing
readonly
Wrap of drawing.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ DocxDrawingProperties
Parse DocxDrawingProperties.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#distance_from_text ⇒ DocxDrawingDistanceFromText (readonly)
Returns distance from text.
12 13 14 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb', line 12 def distance_from_text @distance_from_text end |
#horizontal_position ⇒ DocxDrawingPosition (readonly)
Returns horizontal position.
24 25 26 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb', line 24 def horizontal_position @horizontal_position end |
#object_size ⇒ OOXMLCoordinates (readonly)
Returns size of object.
20 21 22 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb', line 20 def object_size @object_size end |
#relative_height ⇒ Integer (readonly)
Returns relative height of object.
16 17 18 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb', line 16 def relative_height @relative_height end |
#simple_position ⇒ OOXMLCoordinates (readonly)
Returns simple position of object.
18 19 20 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb', line 18 def simple_position @simple_position end |
#size_relative_horizontal ⇒ SizeRelativeHorizontal (readonly)
Returns size of drawing relative to horizontal.
26 27 28 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb', line 26 def size_relative_horizontal @size_relative_horizontal end |
#size_relative_vertical ⇒ SizeRelativeVertical (readonly)
Returns size of drawing relative to vertical.
28 29 30 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb', line 28 def size_relative_vertical @size_relative_vertical end |
#vertical_position ⇒ DocxDrawingPosition (readonly)
Returns vertical position.
22 23 24 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb', line 22 def vertical_position @vertical_position end |
#wrap ⇒ DocxWrapDrawing (readonly)
Returns wrap of drawing.
14 15 16 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb', line 14 def wrap @wrap end |
Instance Method Details
#parse(node) ⇒ DocxDrawingProperties
Parse DocxDrawingProperties
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb', line 33 def parse(node) @distance_from_text = DocxDrawingDistanceFromText.new(parent: self).parse(node) @wrap = DocxWrapDrawing.new(parent: self).parse(node) node.attributes.each do |key, value| case key when 'relativeHeight' @relative_height = value.value.to_i end end node.xpath('*').each do |content_node_child| case content_node_child.name when 'simplePos' @simple_position = OOXMLCoordinates.new(parent: self).parse(content_node_child) when 'extent' @object_size = OOXMLCoordinates.new(parent: self) .parse(content_node_child, x_attr: 'cx', y_attr: 'cy', unit: :emu) when 'positionV' @vertical_position = DocxDrawingPosition.new(parent: self).parse(content_node_child) when 'positionH' @horizontal_position = DocxDrawingPosition.new(parent: self).parse(content_node_child) when 'sizeRelH' @size_relative_horizontal = SizeRelativeHorizontal.new(parent: self).parse(content_node_child) when 'sizeRelV' @size_relative_vertical = SizeRelativeVertical.new(parent: self).parse(content_node_child) end end self end |