Class: ODDB::HtmlTableHandler::Row

Inherits:
Object
  • Object
show all
Defined in:
src/util/html_parser.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Row) initialize(attr)

A new instance of Row



241
242
243
244
# File 'src/util/html_parser.rb', line 241

def initialize(attr)
  @attributes = attr
  @cells = []
end

Instance Attribute Details

- (Object) attributes (readonly)

Returns the value of attribute attributes



240
241
242
# File 'src/util/html_parser.rb', line 240

def attributes
  @attributes
end

- (Object) cells (readonly)

Returns the value of attribute cells



240
241
242
# File 'src/util/html_parser.rb', line 240

def cells
  @cells
end

Instance Method Details

- (Object) add_child(child)



245
246
247
# File 'src/util/html_parser.rb', line 245

def add_child(child)
  @current_cell.add_child(child)
end

- (Object) cdata(x)



248
249
250
251
252
# File 'src/util/html_parser.rb', line 248

def cdata(x)
  if(@cells.size > x)
    @cells.at(x).cdata
  end
end

- (Object) children(x)



253
254
255
256
257
# File 'src/util/html_parser.rb', line 253

def children(x)
  if(@cells.size > x)
    @cells.at(x).children
  end
end

- (Object) current_colspan



258
259
260
# File 'src/util/html_parser.rb', line 258

def current_colspan
  @current_cell.colspan
end

- (Object) each_cell_with_index(&block)



261
262
263
# File 'src/util/html_parser.rb', line 261

def each_cell_with_index(&block)
  @cells.each_with_index(&block)
end

- (Object) height



264
265
266
# File 'src/util/html_parser.rb', line 264

def height
  @cells.collect { |cell| cell.height }.max
end

- (Object) next_cell(attr = {}, keep = false)



267
268
269
270
271
# File 'src/util/html_parser.rb', line 267

def next_cell(attr={}, keep=false)
  @current_cell = Cell.new(attr, keep)
  @cells += Array.new(@current_cell.colspan, @current_cell)
  @current_cell
end

- (Object) next_line



272
273
274
# File 'src/util/html_parser.rb', line 272

def next_line
  @current_cell.next_line
end

- (Object) send_cdata(data)



275
276
277
# File 'src/util/html_parser.rb', line 275

def send_cdata(data)
  (@current_cell || next_cell).send_cdata(data)
end

- (Object) send_format(fmtstr)



278
279
280
# File 'src/util/html_parser.rb', line 278

def send_format(fmtstr)
  (@current_cell || next_cell).send_format(fmtstr)
end