Class: Chicago::Schema::Builders::TableBuilder Abstract
- Inherits:
-
Object
- Object
- Chicago::Schema::Builders::TableBuilder
- Defined in:
- lib/chicago/schema/builders/table_builder.rb
Overview
This class is abstract.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#column_builder ⇒ Object
writeonly
Allows the column builder to be changed when building dimensions & facts.
Instance Method Summary collapse
- #build(klass, name, &block) ⇒ Object
-
#initialize(schema) ⇒ TableBuilder
constructor
A new instance of TableBuilder.
Constructor Details
#initialize(schema) ⇒ TableBuilder
Returns a new instance of TableBuilder.
12 13 14 15 |
# File 'lib/chicago/schema/builders/table_builder.rb', line 12 def initialize(schema) @schema = schema @column_builder = ColumnBuilder end |
Instance Attribute Details
#column_builder=(value) ⇒ Object (writeonly)
Allows the column builder to be changed when building dimensions & facts.
10 11 12 |
# File 'lib/chicago/schema/builders/table_builder.rb', line 10 def column_builder=(value) @column_builder = value end |
Instance Method Details
#build(klass, name, &block) ⇒ Object
17 18 19 20 21 |
# File 'lib/chicago/schema/builders/table_builder.rb', line 17 def build(klass, name, &block) @options[:natural_key] = nil instance_eval(&block) if block_given? klass.new(name, @options) end |