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
#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, #initialize, unzip_file, #with_data?
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.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb', line 6 def anchor @anchor end |
#margins ⇒ Object
Returns the value of attribute margins.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb', line 6 def margins @margins end |
#number_columns ⇒ Symbol (readonly)
Returns Number of Columns.
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 number_columns @number_columns end |
#preset_text_warp ⇒ Object
Returns the value of attribute preset_text_warp.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb', line 6 def preset_text_warp @preset_text_warp end |
#space_columns ⇒ Symbol (readonly)
Returns Spacing between 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 space_columns @space_columns end |
#vertical ⇒ Symbol
Returns Vertical Text.
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 vertical @vertical end |
#wrap ⇒ Object
Returns the value of attribute wrap.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb', line 6 def wrap @wrap end |
Instance Method Details
#parse(node) ⇒ OOXMLShapeBodyProperties
Parse OOXMLShapeBodyProperties
19 20 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 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb', line 19 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 |