Class: Hecks::Adapters::SQLDatabase::SchemaFactory
- Inherits:
-
Object
- Object
- Hecks::Adapters::SQLDatabase::SchemaFactory
- Defined in:
- lib/schema_factory.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(domain_spec) ⇒ SchemaFactory
constructor
A new instance of SchemaFactory.
Constructor Details
#initialize(domain_spec) ⇒ SchemaFactory
Returns a new instance of SchemaFactory.
5 6 7 8 9 |
# File 'lib/schema_factory.rb', line 5 def initialize(domain_spec) @domain_spec = domain_spec @tables = Table.factory(domain_objects) @join_tables = [] end |
Instance Method Details
#build ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/schema_factory.rb', line 11 def build @tables.each do |table| swap_domain_references(table) build_join_tables(table) remove_domain_columns(table) end Schema.new(@tables + @join_tables) end |