lib/rspreadsheet/row.rb in rspreadsheet-0.4.8 vs lib/rspreadsheet/row.rb in rspreadsheet-0.4.9
- old
+ new
@@ -23,10 +23,18 @@
#
# and shifts all other rows down/up appropriatelly.
class Row < XMLTiedItem
include XMLTiedArray_WithRepeatableItems
+ # @!group XMLTiedArray_WithRepeatableItems related methods
+ def subnode_options; {
+ :node_name => 'table-cell',
+ :alt_node_names => ['covered-table-cell'],
+ :repeated_attribute => 'number-columns-repeated'
+ } end
+ def prepare_subitem(coli); Cell.new(worksheet,rowi,coli) end
+
## @return [Worksheet] worksheet which contains the row
# @!attribute [r] worksheet
def worksheet; parent end
## @return [Integer] row index of the row
# @!attribute [r] rowi
@@ -91,11 +99,11 @@
def nonemptycellsindexes
myxmlnode = xmlnode
if myxmlnode.nil?
[]
else
- worksheet.find_nonempty_subnode_indexes(myxmlnode, subitem_xml_options)
+ worksheet.find_nonempty_subnode_indexes(myxmlnode, subnode_options)
end
end
alias :used_range :range
# Inserts row above itself (and shifts itself and all following rows down)
def add_row_above
@@ -116,15 +124,8 @@
def _shift_by(diff)
super
@itemcache.each_value{ |cell| cell.set_rowi(rowi) }
end
- private
- # @!group XMLTiedArray_WithRepeatableItems related methods
- def subitem_xml_options; {:xml_items_node_name => 'table-cell', :xml_repeated_attribute => 'number-columns-repeated'} end
- def prepare_subitem(coli); Cell.new(worksheet,rowi,coli) end
- # @!group XMLTiedItem related methods and extensions
- def xml_options; {:xml_items_node_name => 'table-row', :xml_repeated_attribute => 'number-rows-repeated'} end
-
end
end