Class: Rspreadsheet::UninitializedEmptyRow
Overview
this is a row outside the used bounds. the main purpose of this object is to magically synchronize to existing data, once they are created
Instance Attribute Summary collapse
Instance Method Summary
collapse
#add_cell, #row, #style_name=
Methods inherited from Row
empty_row_node
Constructor Details
Returns a new instance of UninitializedEmptyRow.
272
273
274
275
|
# File 'lib/rspreadsheet/row.rb', line 272
def initialize(aparent_array,arowi)
super(arowi)
@parent_array = aparent_array
end
|
Instance Attribute Details
#parent_array ⇒ Object
271
272
273
|
# File 'lib/rspreadsheet/row.rb', line 271
def parent_array
@parent_array
end
|
Instance Method Details
#cells(coli) ⇒ Object
276
277
278
279
280
281
282
|
# File 'lib/rspreadsheet/row.rb', line 276
def cells(coli)
if still_out_of_used_range?
Cell.new(self,coli,Cell.empty_cell_node).tap{|n| n.mode = :outbound}
else
@parent_array.get_row(@index).cells(coli)
end
end
|
#detach ⇒ Object
290
|
# File 'lib/rspreadsheet/row.rb', line 290
def detach; @parent_array.detach_of_bound_row_group(@index) end
|
#nonemptycells ⇒ Object
293
|
# File 'lib/rspreadsheet/row.rb', line 293
def nonemptycells; [] end
|
#normalize ⇒ Object
283
284
285
286
287
288
289
|
# File 'lib/rspreadsheet/row.rb', line 283
def normalize
if still_out_of_used_range?
self
else
@parent_array.get_row(@index)
end
end
|
#still_out_of_used_range? ⇒ Boolean
291
|
# File 'lib/rspreadsheet/row.rb', line 291
def still_out_of_used_range?; @index >= @parent_array.first_unused_row_index end
|