Class: OoxmlParser::Tab
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Tab
- Defined in:
- lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/tabs/tab.rb
Overview
Class for storing ‘w:tab`, `a:tab` data
Instance Attribute Summary collapse
-
#leader ⇒ Symbol
readonly
Specifies the leader symbol of tab.
-
#position ⇒ OOxmlSize
Specifies the position of the tab stop.
-
#value ⇒ Symbol
(also: #align)
Specifies the style of the tab.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ ParagraphTab
Parse ParagraphTab object.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#leader ⇒ Symbol (readonly)
Returns Specifies the leader symbol of tab.
9 10 11 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/tabs/tab.rb', line 9 def leader @leader end |
#position ⇒ OOxmlSize
Returns Specifies the position of the tab stop.
11 12 13 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/tabs/tab.rb', line 11 def position @position end |
#value ⇒ Symbol Also known as: align
Returns Specifies the style of the tab.
7 8 9 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/tabs/tab.rb', line 7 def value @value end |
Instance Method Details
#parse(node) ⇒ ParagraphTab
Parse ParagraphTab object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties/tabs/tab.rb', line 18 def parse(node) node.attributes.each do |key, value| case key when 'algn', 'val' @value = value_to_symbol(value) when 'leader' @leader = value_to_symbol(value) when 'pos' @position = OoxmlSize.new(value.value.to_f, position_unit(node)) end end self end |