Class: Rspreadsheet::MemberOfRowGroup

Inherits:
LazyDetachableRow show all
Extended by:
Forwardable
Defined in:
lib/rspreadsheet/row.rb

Overview

there are not data in this object, they are taken from RowGroup, but this is only readonly

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LazyDetachableRow

#add_cell, #row, #style_name=

Methods inherited from Row

empty_row_node

Constructor Details

#initialize(arowi, arow_group) ⇒ MemberOfRowGroup

Returns a new instance of MemberOfRowGroup.



252
253
254
255
256
# File 'lib/rspreadsheet/row.rb', line 252

def initialize(arowi,arow_group)
  super(arowi)
  @row_group = arow_group
  raise 'Wrong parameter given' unless @row_group.is_a? RowGroup
end

Instance Attribute Details

#row_groupObject

for dubugging



248
249
250
# File 'lib/rspreadsheet/row.rb', line 248

def row_group
  @row_group
end

Instance Method Details

#cells(coli) ⇒ Object



260
261
262
# File 'lib/rspreadsheet/row.rb', line 260

def cells(coli)
  Cell.new(self,coli,@row_group.cellnodes(coli)).tap{|n| n.mode = :repeated}
end

#detachObject

detaches MemberOfRowGroup from its RowGroup perhaps splitting RowGroup



257
258
259
# File 'lib/rspreadsheet/row.rb', line 257

def detach  # detaches MemberOfRowGroup from its RowGroup perhaps splitting RowGroup
  @row_group.parent_array.detach(@index)
end

#nonemptycellsObject



263
264
265
# File 'lib/rspreadsheet/row.rb', line 263

def nonemptycells
  @row_group.nonemptycellsindexes.collect{ |coli| cells(coli) }
end