Class: OoxmlParser::GridSpan
- Inherits:
-
Object
- Object
- OoxmlParser::GridSpan
- Defined in:
- lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb
Instance Attribute Summary collapse
-
#count_of_merged_cells ⇒ Object
(also: #count_rows_in_span)
Returns the value of attribute count_of_merged_cells.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(type = 'horizontal', value = nil, count_of_merged_cells = 2) ⇒ GridSpan
constructor
A new instance of GridSpan.
-
#parse(node) ⇒ GridSpan
Parse Grid Span data.
Constructor Details
#initialize(type = 'horizontal', value = nil, count_of_merged_cells = 2) ⇒ GridSpan
Returns a new instance of GridSpan.
5 6 7 8 9 |
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb', line 5 def initialize(type = 'horizontal', value = nil, count_of_merged_cells = 2) @type = type @count_of_merged_cells = count_of_merged_cells @value = value end |
Instance Attribute Details
#count_of_merged_cells ⇒ Object Also known as: count_rows_in_span
Returns the value of attribute count_of_merged_cells.
3 4 5 |
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb', line 3 def count_of_merged_cells @count_of_merged_cells end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb', line 3 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb', line 3 def value @value end |
Instance Method Details
#parse(node) ⇒ GridSpan
Parse Grid Span data
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb', line 16 def parse(node) node.attributes.each do |key, value| case key when 'count_rows_in_span' @count_of_merged_cells = value.value when 'val' @value = value.value.to_i when 'type' @type = value.value.to_sym end end self end |