Class: OoxmlParser::TransitionProperties

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, #initialize, unzip_file, #with_data?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#directionObject

Returns the value of attribute direction.



3
4
5
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb', line 3

def direction
  @direction
end

#orientationObject

Returns the value of attribute orientation.



3
4
5
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb', line 3

def orientation
  @orientation
end

#spokesObject

Returns the value of attribute spokes.



3
4
5
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb', line 3

def spokes
  @spokes
end

#through_blackObject

Returns the value of attribute through_black.



3
4
5
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb', line 3

def through_black
  @through_black
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb', line 3

def type
  @type
end

Instance Method Details

#parse(node) ⇒ TransitionProperties

Parse TransitionProperties object

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition_properties/transition_properties.rb', line 8

def parse(node)
  @type = node.name.to_sym
  case node.name
  when 'blinds', 'checker', 'comb', 'cover', 'pull', 'push', 'randomBar', 'strips', 'wipe', 'zoom', 'warp'
    @direction = value_to_symbol(node.attribute('dir')) if node.attribute('dir')
  when 'cut', 'fade'
    @through_black = option_enabled?(node, 'thruBlk')
  when 'split'
    @direction = value_to_symbol(node.attribute('dir')) if node.attribute('dir')
    @orientation = node.attribute('orient').value.to_sym if node.attribute('orient')
  when 'wheel', 'wheelReverse'
    @spokes = option_enabled?(node, 'spokes')
  end
  self
end