Class: OoxmlParser::Transition
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Transition
- Defined in:
- lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
Overview
Class for data of Transition
Instance Attribute Summary collapse
-
#advance_on_click ⇒ Object
Returns the value of attribute advance_on_click.
-
#delay ⇒ Object
Returns the value of attribute delay.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#sound_action ⇒ Object
Returns the value of attribute sound_action.
-
#speed ⇒ Object
Returns the value of attribute speed.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ Transition
Parse Transition object.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#advance_on_click ⇒ Object
Returns the value of attribute advance_on_click.
8 9 10 |
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb', line 8 def advance_on_click @advance_on_click end |
#delay ⇒ Object
Returns the value of attribute delay.
8 9 10 |
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb', line 8 def delay @delay end |
#duration ⇒ Object
Returns the value of attribute duration.
8 9 10 |
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb', line 8 def duration @duration end |
#properties ⇒ Object
Returns the value of attribute properties.
8 9 10 |
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb', line 8 def properties @properties end |
#sound_action ⇒ Object
Returns the value of attribute sound_action.
8 9 10 |
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb', line 8 def sound_action @sound_action end |
#speed ⇒ Object
Returns the value of attribute speed.
8 9 10 |
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb', line 8 def speed @speed end |
Instance Method Details
#parse(node) ⇒ Transition
Parse Transition object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb', line 13 def parse(node) node.xpath('*').each do |node_child| @properties = TransitionProperties.new(parent: self).parse(node_child) case node_child.name when 'sndAc' @sound_action = SoundAction.new(parent: self).parse(node_child) end end node.attributes.each do |key, value| case key when 'spd' @speed = value.value.to_sym when 'advClick' @advance_on_click = attribute_enabled?(value) when 'advTm' @delay = value.value.to_f / 1_000.0 when 'dur' @duration = value.value.to_f / 1_000.0 end end self end |