Class: OoxmlParser::DocxShapeLineElement
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::DocxShapeLineElement
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path/docx_shape_line_element.rb
Overview
Docx Shape Line Element
Instance Attribute Summary collapse
-
#points ⇒ Object
Returns the value of attribute points.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(points = [], parent: nil) ⇒ DocxShapeLineElement
constructor
A new instance of DocxShapeLineElement.
-
#parse(node) ⇒ DocxShapeLineElement
Parse DocxShapeLineElement.
Methods inherited from OOXMLDocumentObject
#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, unzip_file, #with_data?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(points = [], parent: nil) ⇒ DocxShapeLineElement
Returns a new instance of DocxShapeLineElement.
6 7 8 9 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path/docx_shape_line_element.rb', line 6 def initialize(points = [], parent: nil) @points = points @parent = parent end |
Instance Attribute Details
#points ⇒ Object
Returns the value of attribute points.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path/docx_shape_line_element.rb', line 4 def points @points end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path/docx_shape_line_element.rb', line 4 def type @type end |
Instance Method Details
#parse(node) ⇒ DocxShapeLineElement
Parse DocxShapeLineElement
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/custom_geometry/docx_custom_geometry/docx_shape_line_path/docx_shape_line_element.rb', line 14 def parse(node) case node.name when 'moveTo' @type = :move when 'lnTo' @type = :line when 'arcTo' @type = :arc when 'cubicBezTo' @type = :cubic_bezier when 'quadBezTo' @type = :quadratic_bezier when 'close' @type = :close end node.xpath('*').each do |node_child| case node_child.name when 'pt' @points << OOXMLCoordinates.parse(node_child) end end self end |