Class: OoxmlParser::Tabs
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Tabs
- Defined in:
- lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_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
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ Tabs
Returns a new instance of Tabs.
10 11 12 13 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/tabs.rb', line 10 def initialize(parent: nil) @tabs_array = [] super end |
Instance Attribute Details
#tabs_array ⇒ Array, ParagraphTabs
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/tabs.rb', line 8 def tabs_array @tabs_array end |
Instance Method Details
#[](key) ⇒ Array, Column
Returns accessor.
16 17 18 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/tabs.rb', line 16 def [](key) @tabs_array[key] end |
#empty? ⇒ True, False
Returns if empty.
21 22 23 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/tabs.rb', line 21 def empty? @tabs_array.empty? end |
#parse(node) ⇒ Tabs
Parse Tabs data
28 29 30 31 32 33 34 35 36 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/tabs.rb', line 28 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 |