Class: OoxmlParser::DocxBlip

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

Overview

Class for parsing ‘blipFill`

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

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

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#alpha_channelObject

Returns the value of attribute alpha_channel.



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

def alpha_channel
  @alpha_channel
end

#file_referenceFileReference

Returns image structure.

Returns:



7
8
9
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb', line 7

def file_reference
  @file_reference
end

#path_to_media_fileObject Also known as: path

Returns the value of attribute path_to_media_file.



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

def path_to_media_file
  @path_to_media_file
end

Instance Method Details

#parse(node) ⇒ DocxBlip

Parse DocxBlip object

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:



18
19
20
21
22
23
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb', line 18

def parse(node)
  blip_node = node.xpath('a:blip', 'xmlns:a' => 'http://schemas.openxmlformats.org/drawingml/2006/main').first
  return self if blip_node.nil?
  @file_reference = FileReference.new(parent: self).parse(blip_node)
  self
end

#to_strObject



11
12
13
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb', line 11

def to_str
  path_to_media_file
end