Class: Chicago::ETL::KeyBuilder::Factory Private
- Inherits:
-
Object
- Object
- Chicago::ETL::KeyBuilder::Factory
- Defined in:
- lib/chicago/etl/key_builder.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Creates the appropriate KeyBuilder for a star schema table.
Instance Attribute Summary collapse
- #staging_db ⇒ Object readonly private
- #table ⇒ Object readonly private
Instance Method Summary collapse
-
#initialize(table, staging_db) ⇒ Factory
constructor
private
A new instance of Factory.
-
#make ⇒ Object
private
Creates the appropriate key builder for a schema table, depending on the table type and whether rows are identified by original keys or need to be hashed.
Constructor Details
#initialize(table, staging_db) ⇒ Factory
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Factory.
20 21 22 23 |
# File 'lib/chicago/etl/key_builder.rb', line 20 def initialize(table, staging_db) @table = table @staging_db = staging_db end |
Instance Attribute Details
#staging_db ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 |
# File 'lib/chicago/etl/key_builder.rb', line 18 def staging_db @staging_db end |
#table ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 |
# File 'lib/chicago/etl/key_builder.rb', line 18 def table @table end |
Instance Method Details
#make ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates the appropriate key builder for a schema table, depending on the table type and whether rows are identified by original keys or need to be hashed.
28 29 30 31 32 33 34 |
# File 'lib/chicago/etl/key_builder.rb', line 28 def make if dimension? dimension_key_builder elsif fact? FactKeyBuilder.new(staging_db[table.table_name]) end end |