Class: OoxmlParser::CellMerge
- Inherits:
-
Object
- Object
- OoxmlParser::CellMerge
- Defined in:
- lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb
Instance Attribute Summary collapse
-
#count_of_merged_cells ⇒ Object
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.
Class Method Summary collapse
-
.parse(node) ⇒ CellMerge
Parse Merge data.
Instance Method Summary collapse
-
#initialize(type = 'horizontal', value = nil, count_of_merged_cells = 2) ⇒ CellMerge
constructor
A new instance of CellMerge.
Constructor Details
#initialize(type = 'horizontal', value = nil, count_of_merged_cells = 2) ⇒ CellMerge
Returns a new instance of CellMerge.
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
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 |
Class Method Details
.parse(node) ⇒ CellMerge
Parse Merge data
14 15 16 17 18 19 20 |
# File 'lib/ooxml_parser/common_parser/common_data/table/row/cell/merge.rb', line 14 def self.parse(node) merge = CellMerge.new merge.count_of_merged_cells = node.attribute('count_rows_in_span').nil? ? nil : node.attribute('count_rows_in_span').value merge.value = node.attribute('val').nil? ? nil : node.attribute('val').value.to_sym merge.type = node.attribute('type').nil? ? nil : node.attribute('type').value.to_sym merge end |