Class: OoxmlParser::DocxShapeLinePath
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::DocxShapeLinePath
- 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.rb
Overview
Docx Shape Line Path
Instance Attribute Summary collapse
-
#elements ⇒ Object
Returns the value of attribute elements.
-
#fill ⇒ Object
Returns the value of attribute fill.
-
#height ⇒ Object
Returns the value of attribute height.
-
#stroke ⇒ Object
Returns the value of attribute stroke.
-
#width ⇒ Object
Returns the value of attribute width.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(elements = [], parent: nil) ⇒ DocxShapeLinePath
constructor
A new instance of DocxShapeLinePath.
-
#parse(node) ⇒ DocxShapeLinePath
Parse DocxShapeLinePath object.
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(elements = [], parent: nil) ⇒ DocxShapeLinePath
Returns a new instance of DocxShapeLinePath.
7 8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb', line 7 def initialize(elements = [], parent: nil) @elements = elements @parent = parent end |
Instance Attribute Details
#elements ⇒ Object
Returns the value of attribute elements.
5 6 7 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb', line 5 def elements @elements end |
#fill ⇒ Object
Returns the value of attribute fill.
5 6 7 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb', line 5 def fill @fill end |
#height ⇒ Object
Returns the value of attribute height.
5 6 7 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb', line 5 def height @height end |
#stroke ⇒ Object
Returns the value of attribute stroke.
5 6 7 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb', line 5 def stroke @stroke end |
#width ⇒ Object
Returns the value of attribute width.
5 6 7 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb', line 5 def width @width end |
Instance Method Details
#parse(node) ⇒ DocxShapeLinePath
Parse DocxShapeLinePath object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb', line 15 def parse(node) node.attributes.each do |key, value| case key when 'w' @width = value.value.to_f when 'h' @height = value.value.to_f when 'stroke' @stroke = value.value.to_f end end node.xpath('*').each do |node_child| @elements << DocxShapeLineElement.new(parent: self).parse(node_child) end self end |