Class: OoxmlParser::OOXMLShapeBodyProperties

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb

Constant Summary

Constants inherited from OOXMLDocumentObject

OoxmlParser::OOXMLDocumentObject::DEFAULT_DIRECTORY_FOR_MEDIA

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, add_to_xmls_stack, copy_file_and_rename_to_zip, copy_media_file, current_xml, dir, encrypted_file?, get_link_from_rels, media_folder, option_enabled?, unzip_file

Instance Attribute Details

#anchorObject 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

#marginsObject

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

#preset_text_warpObject

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

#wrapObject

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

Class Method Details

.parse(body_pr_node) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_body_properties/ooxml_shape_body_properties.rb', line 10

def self.parse(body_pr_node)
  body_properties = OOXMLShapeBodyProperties.new
  body_properties.margins = ParagraphMargins.parse(body_pr_node)
  body_pr_node.attributes.each do |key, value|
    case key
    when 'wrap'
      body_properties.wrap = value.value.to_sym
    when 'anchor'
      body_properties.anchor = Alignment.parse(value)
    end
  end
  body_pr_node.xpath('*').each do |body_properties_child|
    case body_properties_child.name
    when 'prstTxWarp'
      body_properties.preset_text_warp = PresetTextWarp.parse(body_properties_child)
    end
  end
  body_properties
end