Class: OoxmlParser::Background

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb

Constant Summary

Constants inherited from OOXMLDocumentObject

OOXMLDocumentObject::DEFAULT_DIRECTORY_FOR_MEDIA

Instance Attribute Summary collapse

Class Method Summary collapse

Instance 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

Constructor Details

#initialize(type = nil) ⇒ Background

Returns a new instance of Background.



5
6
7
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb', line 5

def initialize(type = nil)
  @type = type
end

Instance Attribute Details

#fillObject

Returns the value of attribute fill.



3
4
5
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb', line 3

def fill
  @fill
end

#shade_to_titleObject

Returns the value of attribute shade_to_title.



3
4
5
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb', line 3

def shade_to_title
  @shade_to_title
end

Class Method Details

.parse(background_node) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb', line 9

def self.parse(background_node)
  background = Background.new
  background_properties_node = background_node.xpath('p:bgPr').first
  if background_properties_node
    background.shade_to_title = OOXMLDocumentObject.option_enabled?(background_properties_node, 'shadeToTitle')
    background.fill = PresentationFill.parse(background_properties_node)
  end
  background
end