Class: TotallyTabular::Row

Inherits:
Object show all
Defined in:
lib/totally_tabular/row.rb

Instance Method Summary collapse

Constructor Details

#initializeRow

Returns a new instance of Row.



4
5
6
7
# File 'lib/totally_tabular/row.rb', line 4

def initialize
  @helper = HtmlHelper.new
  @attributes = {}
end

Instance Method Details

#attributes!(attributes = {}) ⇒ Object



9
10
11
# File 'lib/totally_tabular/row.rb', line 9

def attributes!(attributes={})
  @attributes = attributes
end

#render(content) ⇒ Object



13
14
15
16
17
# File 'lib/totally_tabular/row.rb', line 13

def render(content)
  if !content.empty?
    @helper.(:tr, content, @attributes)
  end.to_s
end