Class: Lexicon::Common::Production::DatasourceLoader
- Inherits:
-
Object
- Object
- Lexicon::Common::Production::DatasourceLoader
- Includes:
- Mixin::LoggerAware, Mixin::SchemaNamer
- Defined in:
- lib/lexicon/common/production/datasource_loader.rb
Instance Attribute Summary
Attributes included from Mixin::LoggerAware
Instance Method Summary collapse
-
#initialize(shell:, database_factory:, file_loader:, database_url:, table_locker:, psql:) ⇒ DatasourceLoader
constructor
A new instance of DatasourceLoader.
- #load_package(package, only: nil, without: []) ⇒ Object
Methods included from Mixin::LoggerAware
Constructor Details
#initialize(shell:, database_factory:, file_loader:, database_url:, table_locker:, psql:) ⇒ DatasourceLoader
Returns a new instance of DatasourceLoader.
18 19 20 21 22 23 24 25 |
# File 'lib/lexicon/common/production/datasource_loader.rb', line 18 def initialize(shell:, database_factory:, file_loader:, database_url:, table_locker:, psql:) @shell = shell @database_factory = database_factory @file_loader = file_loader @database_url = database_url @table_locker = table_locker @psql = psql end |
Instance Method Details
#load_package(package, only: nil, without: []) ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/lexicon/common/production/datasource_loader.rb', line 33 def load_package(package, only: nil, without: []) case package.schema_version when 1 load_v1(package, only: only, without: without) when 2 load_v2(package, only: only, without: without) else log("Schema version #{package.schema_version} is not supported") end end |