Class: OoxmlParser::DocxPicture

Inherits:
Object
  • Object
show all
Defined in:
lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#chartObject

Returns the value of attribute chart.



5
6
7
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb', line 5

def chart
  @chart
end

#nonvisual_propertiesObject

Returns the value of attribute nonvisual_properties.



5
6
7
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb', line 5

def nonvisual_properties
  @nonvisual_properties
end

#path_to_imageObject Also known as: image

Returns the value of attribute path_to_image.



5
6
7
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb', line 5

def path_to_image
  @path_to_image
end

#propertiesObject Also known as: shape_properties

Returns the value of attribute properties.



5
6
7
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_picture.rb', line 5

def properties
  @properties
end

Class Method Details

.parse(picture_node) ⇒ Object



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

def self.parse(picture_node)
  picture = DocxPicture.new
  picture_node.xpath('*').each do |picture_node_child|
    case picture_node_child.name
    when 'nvPicPr'
    when 'blipFill'
      picture.path_to_image = DocxBlip.parse(picture_node_child)
    when 'spPr'
      picture.properties = DocxShapeProperties.parse(picture_node_child)
    end
  end
  picture
end