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

#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

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.



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

def alpha_channel
  @alpha_channel
end

#file_referenceFileReference

Returns image structure.

Returns:



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

def file_reference
  @file_reference
end

#path_to_media_fileObject Also known as: path

Returns the value of attribute path_to_media_file.



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

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:



21
22
23
24
25
26
27
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb', line 21

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_strString

Returns result of convert of object to string.

Returns:

  • (String)

    result of convert of object to string



14
15
16
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/picture/docx_blip.rb', line 14

def to_str
  path_to_media_file
end