Class: Tableasy::Table::Row

Inherits:
Object
  • Object
show all
Includes:
HtmlAttributes
Defined in:
lib/tableasy/table/row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HtmlAttributes

#html

Constructor Details

#initialize(cells, html = {}) ⇒ Row

Returns a new instance of Row.



7
8
9
10
11
# File 'lib/tableasy/table/row.rb', line 7

def initialize(cells, html = {})
  @cells = cells.select {|cell| cell.value }
  @total, @header = html.delete(:total), html.delete(:header)
  @html = html
end

Instance Attribute Details

#cellsObject (readonly)

Returns the value of attribute cells.



5
6
7
# File 'lib/tableasy/table/row.rb', line 5

def cells
  @cells
end

Instance Method Details

#header_row?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/tableasy/table/row.rb', line 17

def header_row?
  @header
end

#total_row?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/tableasy/table/row.rb', line 13

def total_row?
  @total
end