Class: OoxmlParser::DocxShape

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

Constant Summary

Constants inherited from OOXMLDocumentObject

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

#body_propertiesObject

Returns the value of attribute body_properties.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb', line 6

def body_properties
  @body_properties
end

#non_visual_propertiesObject

Returns the value of attribute non_visual_properties.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb', line 6

def non_visual_properties
  @non_visual_properties
end

#propertiesObject

Returns the value of attribute properties.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb', line 6

def properties
  @properties
end

#styleObject

Returns the value of attribute style.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb', line 6

def style
  @style
end

#text_bodyObject

Returns the value of attribute text_body.



6
7
8
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb', line 6

def text_body
  @text_body
end

Class Method Details

.parse(shape_node) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb', line 8

def self.parse(shape_node)
  shape = DocxShape.new
  shape_node.xpath('*').each do |shape_node_child|
    case shape_node_child.name
    when 'spPr'
      shape.properties = DocxShapeProperties.parse(shape_node_child)
    when 'txbx'
      shape.text_body = OOXMLTextBox.parse(shape_node_child)
    when 'txBody'
      shape.text_body = TextBody.parse(shape_node_child)
    when 'bodyPr'
      shape.body_properties = OOXMLShapeBodyProperties.parse(shape_node_child)
    end
  end
  shape
end