Class: OoxmlParser::Tabs
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Tabs
- Defined in:
- lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb
Overview
Class for working with ‘w:tabs`
Instance Attribute Summary collapse
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#[](key) ⇒ Array, Column
Accessor.
-
#empty? ⇒ True, False
If empty.
-
#initialize(parent: nil) ⇒ Tabs
constructor
A new instance of Tabs.
-
#parse(node) ⇒ Tabs
Parse Tabs data.
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(parent: nil) ⇒ Tabs
Returns a new instance of Tabs.
8 9 10 11 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb', line 8 def initialize(parent: nil) @tabs_array = [] @parent = parent end |
Instance Attribute Details
#tabs_array ⇒ Array, ParagraphTabs
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb', line 6 def tabs_array @tabs_array end |
Instance Method Details
#[](key) ⇒ Array, Column
Returns accessor.
14 15 16 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb', line 14 def [](key) @tabs_array[key] end |
#empty? ⇒ True, False
Returns if empty.
19 20 21 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb', line 19 def empty? @tabs_array.empty? end |
#parse(node) ⇒ Tabs
Parse Tabs data
26 27 28 29 30 31 32 33 34 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb', line 26 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'tab' @tabs_array << Tab.new(parent: self).parse(node_child) end end self end |