Class: OoxmlParser::Sound

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/pptx_parser/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

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

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

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

Returns a new instance of Sound.



11
12
13
14
15
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition/sound_action/sound.rb', line 11

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

Instance Attribute Details

#file_referenceFileReference

Returns image structure.

Returns:



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

def file_reference
  @file_reference
end

#nameString (readonly)

Returns name of sound.

Returns:

  • (String)

    name of sound



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

def name
  @name
end

Instance Method Details

#parse(node) ⇒ Sound

Parse Sound

Parameters:

  • node (Nokogiri::XML:Node)

    with NumberingProperties

Returns:

  • (Sound)

    result of parsing



20
21
22
23
24
25
26
27
28
29
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition/sound_action/sound.rb', line 20

def parse(node)
  @file_reference = FileReference.new(parent: self).parse(node)
  node.attributes.each do |key, value|
    case key
    when 'name'
      @name = value.value.to_s
    end
  end
  self
end