Method: TableHelper::TableBuilder#initialize

Defined in:
lib/table_builder/table_builder.rb

#initialize(objects, template, options) ⇒ TableBuilder

Returns a new instance of TableBuilder.

Raises:

  • (ArgumentError)


10
11
12
13
# File 'lib/table_builder/table_builder.rb', line 10

def initialize objects, template, options
  raise ArgumentError, "TableBuilder expects an Array or ActiveRecord::NamedScope::Scope but found a #{objects.class}" unless Array === objects or ActiveRecord::NamedScope::Scope === objects
  @objects, @template, @options = objects, template, options
end