Class: Kamome::Loader
- Inherits:
-
Object
- Object
- Kamome::Loader
- Defined in:
- lib/kamome/loader.rb
Instance Method Summary collapse
-
#call(operation:) {|model, lineno| ... } ⇒ Array
Csv digest.
-
#initialize(config:) ⇒ Loader
constructor
A new instance of Loader.
Constructor Details
#initialize(config:) ⇒ Loader
Returns a new instance of Loader.
9 10 11 |
# File 'lib/kamome/loader.rb', line 9 def initialize(config:) @config = config end |
Instance Method Details
#call(operation:) {|model, lineno| ... } ⇒ Array
Returns csv digest.
17 18 19 20 21 22 |
# File 'lib/kamome/loader.rb', line 17 def call(operation:, &block) operation.urls.map do |url| csv_path = download(url) call_csv_handler(operation, csv_path, &block) end end |