diff options
Diffstat (limited to 'lib/bulk_imports/pipeline.rb')
-rw-r--r-- | lib/bulk_imports/pipeline.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/bulk_imports/pipeline.rb b/lib/bulk_imports/pipeline.rb index a44f8fc7193..06b81b5da14 100644 --- a/lib/bulk_imports/pipeline.rb +++ b/lib/bulk_imports/pipeline.rb @@ -10,16 +10,16 @@ module BulkImports private - def extractors - @extractors ||= self.class.extractors.map(&method(:instantiate)) + def extractor + @extractor ||= instantiate(self.class.get_extractor) end def transformers @transformers ||= self.class.transformers.map(&method(:instantiate)) end - def loaders - @loaders ||= self.class.loaders.map(&method(:instantiate)) + def loader + @loaders ||= instantiate(self.class.get_loader) end def after_run @@ -41,7 +41,7 @@ module BulkImports class_methods do def extractor(klass, options = nil) - add_attribute(:extractors, klass, options) + class_attributes[:extractor] = { klass: klass, options: options } end def transformer(klass, options = nil) @@ -49,23 +49,23 @@ module BulkImports end def loader(klass, options = nil) - add_attribute(:loaders, klass, options) + class_attributes[:loader] = { klass: klass, options: options } end def after_run(&block) class_attributes[:after_run] = block end - def extractors - class_attributes[:extractors] + def get_extractor + class_attributes[:extractor] end def transformers class_attributes[:transformers] end - def loaders - class_attributes[:loaders] + def get_loader + class_attributes[:loader] end def after_run_callback |