Class: OoxmlParser::Transition
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Transition
- Defined in:
- lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb
Constant Summary
Constants inherited from OOXMLDocumentObject
OOXMLDocumentObject::DEFAULT_DIRECTORY_FOR_MEDIA
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.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(properties = TransitionProperties.new) ⇒ Transition
constructor
A new instance of Transition.
Methods inherited from OOXMLDocumentObject
#==, add_to_xmls_stack, copy_file_and_rename_to_zip, copy_media_file, current_xml, dir, encrypted_file?, get_link_from_rels, media_folder, option_enabled?, unzip_file
Constructor Details
#initialize(properties = TransitionProperties.new) ⇒ Transition
Returns a new instance of Transition.
7 8 9 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb', line 7 def initialize(properties = TransitionProperties.new) @properties = properties end |
Instance Attribute Details
#advance_on_click ⇒ Object
Returns the value of attribute advance_on_click.
5 6 7 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb', line 5 def advance_on_click @advance_on_click end |
#delay ⇒ Object
Returns the value of attribute delay.
5 6 7 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb', line 5 def delay @delay end |
#duration ⇒ Object
Returns the value of attribute duration.
5 6 7 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb', line 5 def duration @duration end |
#properties ⇒ Object
Returns the value of attribute properties.
5 6 7 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb', line 5 def properties @properties end |
#sound_action ⇒ Object
Returns the value of attribute sound_action.
5 6 7 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb', line 5 def sound_action @sound_action end |
#speed ⇒ Object
Returns the value of attribute speed.
5 6 7 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb', line 5 def speed @speed end |
Class Method Details
.parse(transition_node) ⇒ Object
11 12 13 14 15 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/transition/transition.rb', line 11 def self.parse(transition_node) transition = Transition.new transition_node.xpath('*').each do |transition_node_child| transition.properties = TransitionProperties.parse(transition_node_child) transition.sound_action = SoundAction.parse(transition_node_child) end transition_node.attributes.each do |key, value| case key when 'spd' transition.speed = value.value.to_sym when 'advClick' transition.advance_on_click = OOXMLDocumentObject.option_enabled?(transition_node, key) when 'advTm' transition.delay = value.value.to_f / 1_000.0 when 'dur' transition.duration = value.value.to_f / 1_000.0 end end transition end |