Class: RedshiftConnector::UrlDataFileBundle
- Inherits:
-
AbstractDataFileBundle
- Object
- AbstractDataFileBundle
- RedshiftConnector::UrlDataFileBundle
- Defined in:
- lib/redshift_connector/url_data_file_bundle.rb
Constant Summary
Constants inherited from AbstractDataFileBundle
AbstractDataFileBundle::REPORT_SIZE
Instance Attribute Summary collapse
-
#data_files ⇒ Object
readonly
Returns the value of attribute data_files.
Attributes inherited from AbstractDataFileBundle
Instance Method Summary collapse
-
#initialize(urls, format: :redshift_csv, filter: nil, logger: RedshiftConnector.logger) ⇒ UrlDataFileBundle
constructor
A new instance of UrlDataFileBundle.
Methods inherited from AbstractDataFileBundle
#all_data_objects, #each_batch, #each_object, #each_row
Constructor Details
#initialize(urls, format: :redshift_csv, filter: nil, logger: RedshiftConnector.logger) ⇒ UrlDataFileBundle
Returns a new instance of UrlDataFileBundle.
9 10 11 12 13 14 15 |
# File 'lib/redshift_connector/url_data_file_bundle.rb', line 9 def initialize(urls, format: :redshift_csv, filter: nil, logger: RedshiftConnector.logger) super filter: filter, batch_size: 1000, logger: logger reader_class = Reader.get(format) raise ArgumentError, 'no URL given' if urls.empty? @data_files = urls.map {|url| UrlDataFile.new(URI.parse(url), reader_class: reader_class) } logger.info "reader: #{reader_class}" end |
Instance Attribute Details
#data_files ⇒ Object (readonly)
Returns the value of attribute data_files.
17 18 19 |
# File 'lib/redshift_connector/url_data_file_bundle.rb', line 17 def data_files @data_files end |