Class: ActiveRecordImporter::DataProcessor
- Inherits:
-
Object
- Object
- ActiveRecordImporter::DataProcessor
- Defined in:
- lib/active_record_importer/data_processor.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#find_attributes ⇒ Object
readonly
Returns the value of attribute find_attributes.
-
#import ⇒ Object
readonly
Returns the value of attribute import.
-
#importable ⇒ Object
readonly
Returns the value of attribute importable.
-
#instance ⇒ Object
readonly
Returns the value of attribute instance.
-
#row_attrs ⇒ Object
readonly
Returns the value of attribute row_attrs.
-
#row_errors ⇒ Object
readonly
Returns the value of attribute row_errors.
Instance Method Summary collapse
-
#initialize(import, row_attrs) ⇒ DataProcessor
constructor
A new instance of DataProcessor.
- #process ⇒ Object
Constructor Details
#initialize(import, row_attrs) ⇒ DataProcessor
Returns a new instance of DataProcessor.
9 10 11 12 13 |
# File 'lib/active_record_importer/data_processor.rb', line 9 def initialize(import, row_attrs) @import = import @importable = import.resource.safe_constantize @row_attrs = row_attrs end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/active_record_importer/data_processor.rb', line 3 def attributes @attributes end |
#find_attributes ⇒ Object (readonly)
Returns the value of attribute find_attributes.
3 4 5 |
# File 'lib/active_record_importer/data_processor.rb', line 3 def find_attributes @find_attributes end |
#import ⇒ Object (readonly)
Returns the value of attribute import.
3 4 5 |
# File 'lib/active_record_importer/data_processor.rb', line 3 def import @import end |
#importable ⇒ Object (readonly)
Returns the value of attribute importable.
3 4 5 |
# File 'lib/active_record_importer/data_processor.rb', line 3 def importable @importable end |
#instance ⇒ Object (readonly)
Returns the value of attribute instance.
3 4 5 |
# File 'lib/active_record_importer/data_processor.rb', line 3 def instance @instance end |
#row_attrs ⇒ Object (readonly)
Returns the value of attribute row_attrs.
3 4 5 |
# File 'lib/active_record_importer/data_processor.rb', line 3 def row_attrs @row_attrs end |
#row_errors ⇒ Object (readonly)
Returns the value of attribute row_errors.
3 4 5 |
# File 'lib/active_record_importer/data_processor.rb', line 3 def row_errors @row_errors end |
Instance Method Details
#process ⇒ Object
15 16 17 18 19 |
# File 'lib/active_record_importer/data_processor.rb', line 15 def process fetch_instance_attributes fetch_find_attributes create_instance end |