Class: OoxmlParser::Background
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Background
- Defined in:
- lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb
Overview
Class for parsing ‘bg` tag
Instance Attribute Summary collapse
-
#fill ⇒ Object
Returns the value of attribute fill.
-
#properties ⇒ BackgroundProperties
Properties.
-
#shade_to_title ⇒ Object
Returns the value of attribute shade_to_title.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(type = nil) ⇒ Background
constructor
A new instance of Background.
-
#parse(node) ⇒ Background
Parse Background object.
Methods inherited from OOXMLDocumentObject
#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, unzip_file, #with_data?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(type = nil) ⇒ Background
Returns a new instance of Background.
9 10 11 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb', line 9 def initialize(type = nil) @type = type end |
Instance Attribute Details
#fill ⇒ Object
Returns the value of attribute fill.
5 6 7 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb', line 5 def fill @fill end |
#properties ⇒ BackgroundProperties
Returns properties.
7 8 9 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb', line 7 def properties @properties end |
#shade_to_title ⇒ Object
Returns the value of attribute shade_to_title.
5 6 7 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb', line 5 def shade_to_title @shade_to_title end |
Instance Method Details
#parse(node) ⇒ Background
Parse Background object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb', line 16 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'bgPr' @properties = BackgroundProperties.new(parent: self).parse(node_child) end end background_properties_node = node.xpath('p:bgPr').first if background_properties_node @shade_to_title = attribute_enabled?(background_properties_node, 'shadeToTitle') @fill = PresentationFill.new(parent: self).parse(background_properties_node) end self end |