Class: OoxmlParser::OOXMLShapeBodyProperties
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::OOXMLShapeBodyProperties
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb
Overview
Class for parsing ‘bodyPr`
Instance Attribute Summary collapse
-
#anchor ⇒ Object
(also: #vertical_align)
Returns the value of attribute anchor.
-
#margins ⇒ Object
Returns the value of attribute margins.
-
#number_columns ⇒ Symbol
readonly
Number of Columns.
-
#preset_text_warp ⇒ Object
Returns the value of attribute preset_text_warp.
-
#space_columns ⇒ Symbol
readonly
Spacing between columns.
-
#vertical ⇒ Symbol
Vertical Text.
-
#wrap ⇒ Object
Returns the value of attribute wrap.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ OOXMLShapeBodyProperties
Parse OOXMLShapeBodyProperties.
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
#anchor ⇒ Object Also known as: vertical_align
Returns the value of attribute anchor.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb', line 8 def anchor @anchor end |
#margins ⇒ Object
Returns the value of attribute margins.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb', line 8 def margins @margins end |
#number_columns ⇒ Symbol (readonly)
Returns Number of Columns.
12 13 14 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb', line 12 def number_columns @number_columns end |
#preset_text_warp ⇒ Object
Returns the value of attribute preset_text_warp.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb', line 8 def preset_text_warp @preset_text_warp end |
#space_columns ⇒ Symbol (readonly)
Returns Spacing between columns.
14 15 16 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb', line 14 def space_columns @space_columns end |
#vertical ⇒ Symbol
Returns Vertical Text.
10 11 12 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb', line 10 def vertical @vertical end |
#wrap ⇒ Object
Returns the value of attribute wrap.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb', line 8 def wrap @wrap end |
Instance Method Details
#parse(node) ⇒ OOXMLShapeBodyProperties
Parse OOXMLShapeBodyProperties
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb', line 21 def parse(node) @margins = ParagraphMargins.new(OoxmlSize.new(0.127, :centimeter), OoxmlSize.new(0.127, :centimeter), OoxmlSize.new(0.254, :centimeter), OoxmlSize.new(0.254, :centimeter)).parse(node) node.attributes.each do |key, value| case key when 'wrap' @wrap = value.value.to_sym when 'anchor' @anchor = value_to_symbol(value) when 'vert' @vertical = value_to_symbol(value) when 'numCol' @number_columns = value.value.to_i when 'spcCol' @space_columns = OoxmlSize.new(value.value.to_f, :emu) end end node.xpath('*').each do |node_child| case node_child.name when 'prstTxWarp' @preset_text_warp = PresetTextWarp.new(parent: self).parse(node_child) end end self end |