Class: Cranium::DataReader
- Inherits:
-
Object
- Object
- Cranium::DataReader
- Defined in:
- lib/cranium/data_reader.rb
Instance Method Summary collapse
-
#initialize(source) ⇒ DataReader
constructor
A new instance of DataReader.
- #read(&block) ⇒ Object
Constructor Details
#initialize(source) ⇒ DataReader
Returns a new instance of DataReader.
5 6 7 8 |
# File 'lib/cranium/data_reader.rb', line 5 def initialize(source) @source = source @source_field_names = @source.fields.keys end |
Instance Method Details
#read(&block) ⇒ Object
12 13 14 15 16 |
# File 'lib/cranium/data_reader.rb', line 12 def read(&block) @source.files.each do |input_file| read_input_file File.join(Cranium.configuration.upload_path, input_file), block end end |