module CSVImporter::Dsl
This Dsl
extends a class that includes CSVImporter
It is a thin proxy to the Config
object
Public Instance Methods
after_build(&block)
click to toggle source
# File lib/csv_importer/dsl.rb, line 23 def after_build(&block) config.after_build(block) end
after_save(&block)
click to toggle source
# File lib/csv_importer/dsl.rb, line 27 def after_save(&block) config.after_save(block) end
column(name, options={})
click to toggle source
# File lib/csv_importer/dsl.rb, line 9 def column(name, options={}) config.column_definitions << options.merge(name: name) end
identifier(*params)
click to toggle source
# File lib/csv_importer/dsl.rb, line 13 def identifier(*params) config.identifiers = params.first.is_a?(Proc) ? params.first : params end
Also aliased as: identifiers
model(model_klass)
click to toggle source
# File lib/csv_importer/dsl.rb, line 5 def model(model_klass) config.model = model_klass end
when_invalid(action)
click to toggle source
# File lib/csv_importer/dsl.rb, line 19 def when_invalid(action) config.when_invalid = action end