class TableCreator::Row

Attributes

cols[RW]
options[RW]
parent[RW]

Public Class Methods

new(row, parent, options = {}) click to toggle source
# File lib/table_creator/row.rb, line 7
def initialize(row, parent, options = {})
  @parent = parent
  @options = options
  @cols  = []
  row.each do |col|
    @cols << Col.new(col, row, options[:type])
  end
  self
end

Public Instance Methods

to_csv() click to toggle source
# File lib/table_creator/row.rb, line 17
def to_csv
  cols.map(&:to_csv).flatten.join(',')
end
to_html() click to toggle source
# File lib/table_creator/row.rb, line 21
def to_html
  content_tag :tr, cols.map(&:to_html).join.html_safe, options.except(:type)
end