Class: OoxmlParser::DocxShapeProperties
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::DocxShapeProperties
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb
Overview
DOCX Shape Properties
Instance Attribute Summary collapse
-
#blip_fill ⇒ BlipFill
readonly
BlipFill data.
-
#custom_geometry ⇒ PresetGeometry
readonly
Is some geometry custom.
-
#fill_color ⇒ DocxColor
(also: #fill)
readonly
Color of object.
-
#line ⇒ DocxShapeLine
readonly
Line info.
-
#preset_geometry ⇒ PresetGeometry
(also: #preset)
readonly
Preset geometry of object.
-
#shape_size ⇒ DocxShapeSize
(also: #transform)
readonly
Size of shape.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ DocxShapeProperties
constructor
A new instance of DocxShapeProperties.
-
#parse(node) ⇒ DocxShapeProperties
Parse DocxShapeProperties 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(parent: nil) ⇒ DocxShapeProperties
Returns a new instance of DocxShapeProperties.
30 31 32 33 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb', line 30 def initialize(parent: nil) @line = DocxShapeLine.new super end |
Instance Attribute Details
#blip_fill ⇒ BlipFill (readonly)
Returns BlipFill data.
24 25 26 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb', line 24 def blip_fill @blip_fill end |
#custom_geometry ⇒ PresetGeometry (readonly)
Returns is some geometry custom.
22 23 24 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb', line 22 def custom_geometry @custom_geometry end |
#fill_color ⇒ DocxColor (readonly) Also known as: fill
Returns color of object.
18 19 20 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb', line 18 def fill_color @fill_color end |
#line ⇒ DocxShapeLine (readonly)
Returns line info.
20 21 22 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb', line 20 def line @line end |
#preset_geometry ⇒ PresetGeometry (readonly) Also known as: preset
Returns preset geometry of object.
16 17 18 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb', line 16 def preset_geometry @preset_geometry end |
#shape_size ⇒ DocxShapeSize (readonly) Also known as: transform
Returns size of shape.
14 15 16 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb', line 14 def shape_size @shape_size end |
Instance Method Details
#parse(node) ⇒ DocxShapeProperties
Parse DocxShapeProperties object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb', line 38 def parse(node) @fill_color = DocxColor.new(parent: self).parse(node) node.xpath('*').each do |node_child| case node_child.name when 'xfrm' @shape_size = DocxShapeSize.new(parent: self).parse(node_child) when 'prstGeom' @preset_geometry = PresetGeometry.new(parent: self).parse(node_child) when 'ln' @line = DocxShapeLine.new(parent: self).parse(node_child) when 'blipFill' @blip_fill = BlipFill.new(parent: self).parse(node_child) when 'custGeom' @preset_geometry = PresetGeometry.new(parent: self).parse(node_child) @preset_geometry.name = :custom @custom_geometry = OOXMLCustomGeometry.new(parent: self).parse(node_child) end end self end |