Class: OoxmlParser::TargetElement
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::TargetElement
- Defined in:
- lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb
Instance Attribute Summary collapse
-
#built_in ⇒ Object
Returns the value of attribute built_in.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(type = '', id = '', parent: nil) ⇒ TargetElement
constructor
A new instance of TargetElement.
-
#parse(node) ⇒ TargetElement
Parse TargetElement object.
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 = '', id = '', parent: nil) ⇒ TargetElement
Returns a new instance of TargetElement.
5 6 7 8 9 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb', line 5 def initialize(type = '', id = '', parent: nil) @type = type @id = id @parent = parent end |
Instance Attribute Details
#built_in ⇒ Object
Returns the value of attribute built_in.
3 4 5 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb', line 3 def built_in @built_in end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb', line 3 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb', line 3 def type @type end |
Instance Method Details
#parse(node) ⇒ TargetElement
Parse TargetElement object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb', line 14 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'sldTgt' @type = :slide when 'sndTgt' @type = :sound @name = node_child.attribute('name').value @built_in = node_child.attribute('builtIn').value ? StringHelper.to_bool(node_child.attribute('builtIn').value) : false when 'spTgt' @type = :shape @id = node_child.attribute('spid').value when 'inkTgt' @type = :ink @id = node_child.attribute('spid').value end end self end |