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
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(elements = [], parent: nil) ⇒ DocxShapeLinePath
Returns a new instance of DocxShapeLinePath.
9 10 11 12 |
# 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 9 def initialize(elements = [], parent: nil) @elements = elements super(parent: parent) end |
Instance Attribute Details
#elements ⇒ Object
Returns the value of attribute elements.
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.rb', line 7 def elements @elements end |
#fill ⇒ Object
Returns the value of attribute fill.
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.rb', line 7 def fill @fill end |
#height ⇒ Object
Returns the value of attribute height.
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.rb', line 7 def height @height end |
#stroke ⇒ Object
Returns the value of attribute stroke.
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.rb', line 7 def stroke @stroke end |
#width ⇒ Object
Returns the value of attribute width.
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.rb', line 7 def width @width end |
Instance Method Details
#parse(node) ⇒ DocxShapeLinePath
Parse DocxShapeLinePath object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# 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 17 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 |