Class: OoxmlParser::Sound
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Sound
- 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
-
#file_reference ⇒ FileReference
Image structure.
-
#name ⇒ String
readonly
Name of sound.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(path = '', name = '', parent: nil) ⇒ Sound
constructor
A new instance of Sound.
-
#parse(node) ⇒ Sound
Parse Sound.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
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_reference ⇒ FileReference
Returns image structure.
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 |
#name ⇒ String (readonly)
Returns 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
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 |