Class: OoxmlParser::TimeNode
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::TimeNode
- Defined in:
- lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb
Overview
Class for parsing TimeNode tags
Instance Attribute Summary collapse
-
#common_time_node ⇒ Object
Returns the value of attribute common_time_node.
-
#next_conditions_list ⇒ Object
Returns the value of attribute next_conditions_list.
-
#previous_conditions_list ⇒ Object
Returns the value of attribute previous_conditions_list.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from OOXMLDocumentObject
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type = nil, parent: nil) ⇒ TimeNode
constructor
A new instance of TimeNode.
-
#parse(node) ⇒ TimeNode
Parse TimeNode.
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
Constructor Details
#initialize(type = nil, parent: nil) ⇒ TimeNode
Returns a new instance of TimeNode.
9 10 11 12 13 14 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb', line 9 def initialize(type = nil, parent: nil) @type = type @previous_conditions_list = [] @next_conditions_list = [] @parent = parent end |
Instance Attribute Details
#common_time_node ⇒ Object
Returns the value of attribute common_time_node.
7 8 9 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb', line 7 def common_time_node @common_time_node end |
#next_conditions_list ⇒ Object
Returns the value of attribute next_conditions_list.
7 8 9 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb', line 7 def next_conditions_list @next_conditions_list end |
#previous_conditions_list ⇒ Object
Returns the value of attribute previous_conditions_list.
7 8 9 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb', line 7 def previous_conditions_list @previous_conditions_list end |
#type ⇒ Object
Returns the value of attribute type.
7 8 9 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb', line 7 def type @type end |
Class Method Details
.parse_list(timing_list_node) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb', line 31 def self.parse_list(timing_list_node) timings = [] timing_list_node.xpath('*').each do |time_node| case time_node.name when 'par' timings << TimeNode.new(:parallel, parent: timings).parse(time_node) when 'seq' timings << TimeNode.new(:sequence, parent: timings).parse(time_node) when 'excl' timings << TimeNode.new(:exclusive, parent: timings).parse(time_node) when 'anim' timings << TimeNode.new(:animate, parent: timings).parse(time_node) when 'set' timings << SetTimeNode.new(parent: timings).parse(time_node) when 'animEffect' timings << AnimationEffect.new(parent: timings).parse(time_node) when 'video' timings << :video when 'audio' timings << :audio end end timings end |
Instance Method Details
#parse(node) ⇒ TimeNode
Parse TimeNode
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb', line 19 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'cTn' @common_time_node = CommonTiming.new(parent: self).parse(node_child) when 'prevCondLst' @previous_conditions_list = Condition.parse_list(node_child) end end self end |