Class: BigShift::Factory
- Inherits:
-
Object
- Object
- BigShift::Factory
- Defined in:
- lib/bigshift/cli.rb
Instance Method Summary collapse
- #big_query_dataset ⇒ Object
- #cleaner ⇒ Object
- #cloud_storage_transfer ⇒ Object
-
#initialize(config) ⇒ Factory
constructor
A new instance of Factory.
- #redshift_table_schema ⇒ Object
- #redshift_unloader ⇒ Object
- #s3_resource ⇒ Object
Constructor Details
#initialize(config) ⇒ Factory
126 127 128 |
# File 'lib/bigshift/cli.rb', line 126 def initialize(config) @config = config end |
Instance Method Details
#big_query_dataset ⇒ Object
142 143 144 |
# File 'lib/bigshift/cli.rb', line 142 def big_query_dataset @big_query_dataset ||= BigQuery::Dataset.new(bq_service, raw_gcp_credentials['project_id'], @config[:bq_dataset_id], logger: logger) end |
#cleaner ⇒ Object
146 147 148 |
# File 'lib/bigshift/cli.rb', line 146 def cleaner @cleaner ||= Cleaner.new(s3_resource, cs_service, logger: logger) end |
#cloud_storage_transfer ⇒ Object
134 135 136 |
# File 'lib/bigshift/cli.rb', line 134 def cloud_storage_transfer @cloud_storage_transfer ||= CloudStorageTransfer.new(cs_transfer_service, raw_gcp_credentials['project_id'], aws_credentials, logger: logger) end |
#redshift_table_schema ⇒ Object
138 139 140 |
# File 'lib/bigshift/cli.rb', line 138 def redshift_table_schema @redshift_table_schema ||= RedshiftTableSchema.new(@config[:rs_table_name], rs_connection) end |
#redshift_unloader ⇒ Object
130 131 132 |
# File 'lib/bigshift/cli.rb', line 130 def redshift_unloader @redshift_unloader ||= RedshiftUnloader.new(rs_connection, aws_credentials, logger: logger) end |
#s3_resource ⇒ Object
150 151 152 153 154 155 |
# File 'lib/bigshift/cli.rb', line 150 def s3_resource @s3_resource ||= Aws::S3::Resource.new( region: aws_region, credentials: aws_credentials ) end |