Class: TableFor::RowBuilder

Inherits:
Struct
  • Object
show all
Defined in:
lib/table_for/row_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#recordObject

Returns the value of attribute record

Returns:

  • (Object)

    the current value of record



2
3
4
# File 'lib/table_for/row_builder.rb', line 2

def record
  @record
end

#tableObject

Returns the value of attribute table

Returns:

  • (Object)

    the current value of table



2
3
4
# File 'lib/table_for/row_builder.rb', line 2

def table
  @table
end

Instance Method Details

#cell(value) ⇒ Object



10
11
12
13
14
# File 'lib/table_for/row_builder.rb', line 10

def cell(value)
  (:td) do
    if value.is_a?(Symbol) then record.send(value).to_s else value.to_s end
  end
end

#cells(*values) ⇒ Object



6
7
8
# File 'lib/table_for/row_builder.rb', line 6

def cells(*values)
  values.map { |v| cell(v) }.join.html_safe
end