Class: OoxmlParser::TimeNode

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/pptx_parser/presentation/slide/slide/timing/time_node_list/time_node.rb

Overview

Class for parsing TimeNode 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(type = nil, parent: nil) ⇒ TimeNode

Returns a new instance of TimeNode.



11
12
13
14
15
16
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/slide/timing/time_node_list/time_node.rb', line 11

def initialize(type = nil, parent: nil)
  @type = type
  @previous_conditions_list = []
  @next_conditions_list = []
  super(parent: parent)
end

Instance Attribute Details

#common_time_nodeObject

Returns the value of attribute common_time_node.



9
10
11
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/slide/timing/time_node_list/time_node.rb', line 9

def common_time_node
  @common_time_node
end

#next_conditions_listObject

Returns the value of attribute next_conditions_list.



9
10
11
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/slide/timing/time_node_list/time_node.rb', line 9

def next_conditions_list
  @next_conditions_list
end

#previous_conditions_listObject

Returns the value of attribute previous_conditions_list.



9
10
11
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/slide/timing/time_node_list/time_node.rb', line 9

def previous_conditions_list
  @previous_conditions_list
end

#typeObject

Returns the value of attribute type.



9
10
11
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/slide/timing/time_node_list/time_node.rb', line 9

def type
  @type
end

Instance Method Details

#parse(node) ⇒ TimeNode

Parse TimeNode

Parameters:

  • node (Nokogiri::XML::Element)

    node to parse

Returns:

  • (TimeNode)

    value of SheetFormatProperties



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/ooxml_parser/pptx_parser/presentation/slide/slide/timing/time_node_list/time_node.rb', line 21

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 = ConditionList.new(parent: self).parse(node_child)
    end
  end
  self
end