Module: HtmlTable

Defined in:
lib/html_table.rb,
lib/html_table/version.rb

Defined Under Namespace

Classes: TableBuilder, TableRowBuilder

Constant Summary collapse

VERSION =
"0.0.1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#table_builderObject (readonly)

Returns the value of attribute table_builder.



5
6
7
# File 'lib/html_table.rb', line 5

def table_builder
  @table_builder
end

Instance Method Details

#set_table_builder(collection, options, &block) ⇒ Object



14
15
16
# File 'lib/html_table.rb', line 14

def set_table_builder(collection, options, &block)
  @table_builder = TableBuilder.new(collection, options, &block)
end

#table(collection = @collection, *args, &block) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/html_table.rb', line 6

def table(collection=@collection, *args, &block)
  if collection && collection.any?
    options = args.extract_options!
    set_table_builder(collection, options, &block)
    @table_builder.to_s
  end
end