Class: QueueryClient::DataFile
- Inherits:
-
Object
- Object
- QueueryClient::DataFile
- Defined in:
- lib/queuery_client/data_file.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#data_object? ⇒ Boolean
6 7 8 |
# File 'lib/queuery_client/data_file.rb', line 6 def data_object? /\.csv(?:\.|\z)/ =~ File.basename(key) end |
#each_row(&block) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/queuery_client/data_file.rb', line 14 def each_row(&block) f = open begin if gzipped_object? f = Zlib::GzipReader.new(f) end RedshiftCsvFile.new(f).each(&block) ensure f.close end end |
#gzipped_object? ⇒ Boolean
10 11 12 |
# File 'lib/queuery_client/data_file.rb', line 10 def gzipped_object? File.extname(key) == '.gz' end |