Class: OoxmlParser::Sound

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

Overview

Class for parsing ‘snd` tags

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, unzip_file, #with_data?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

#initialize(path = '', name = '', parent: nil) ⇒ Sound

Returns a new instance of Sound.



8
9
10
11
12
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb', line 8

def initialize(path = '', name = '', parent: nil)
  @path = path
  @name = name
  @parent = parent
end

Instance Attribute Details

#file_referenceFileReference

Returns image structure.

Returns:



6
7
8
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb', line 6

def file_reference
  @file_reference
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb', line 4

def name
  @name
end

Instance Method Details

#parse(node) ⇒ Sound

Parse Sound

Parameters:

  • node (Nokogiri::XML:Node)

    with NumberingProperties

Returns:

  • (Sound)

    result of parsing



17
18
19
20
21
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb', line 17

def parse(node)
  @file_reference = FileReference.new(parent: self).parse(node)
  @name = node.attribute('name').value
  self
end