Class: Ods::Row
- Inherits:
-
Object
- Object
- Ods::Row
- Defined in:
- lib/ods/row.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#sheet ⇒ Object
readonly
Returns the value of attribute sheet.
Instance Method Summary collapse
- #cols ⇒ Object
-
#initialize(content, sheet) ⇒ Row
constructor
A new instance of Row.
Constructor Details
#initialize(content, sheet) ⇒ Row
Returns a new instance of Row.
5 6 7 8 |
# File 'lib/ods/row.rb', line 5 def initialize(content, sheet) @content = content @sheet = sheet end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
3 4 5 |
# File 'lib/ods/row.rb', line 3 def content @content end |
#sheet ⇒ Object (readonly)
Returns the value of attribute sheet.
3 4 5 |
# File 'lib/ods/row.rb', line 3 def sheet @sheet end |
Instance Method Details
#cols ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ods/row.rb', line 10 def cols return @cols if @cols @cols = [] content.xpath('table:table-cell').each do |node| repeat = node['table:number-columns-repeated'] || 1 a_cell = Cell.new(node, self) repeat.to_i.times do @cols << a_cell end end @cols end |