Class: Importo::BaseImporter
- Inherits:
-
Object
- Object
- Importo::BaseImporter
- Includes:
- ActionView::Helpers::SanitizeHelper, ActiveSupport::Callbacks, Exportable, Importable, ImporterDsl, Original, ResultFeedback, Revertable
- Defined in:
- app/importers/importo/base_importer.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#blob ⇒ Object
readonly
Returns the value of attribute blob.
-
#import ⇒ Object
readonly
Returns the value of attribute import.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(imprt = nil) ⇒ BaseImporter
constructor
A new instance of BaseImporter.
- #state_changed(_import, transition) ⇒ Object
Methods included from ResultFeedback
Methods included from Original
#col_for, #invalid_header_names, #original, #structure_valid?
Methods included from Revertable
Methods included from Exportable
#export, #export_columns, #export_data, #export_file, #export_row, #export_scope, #sample_data, #sample_file
Methods included from Importable
#after_build, #after_save, #after_validate, #around_build, #around_save, #around_validate, #before_build, #before_save, #before_validate, #build, #convert_values, #import!, #populate, #process_data_row
Constructor Details
#initialize(imprt = nil) ⇒ BaseImporter
Returns a new instance of BaseImporter.
26 27 28 29 |
# File 'app/importers/importo/base_importer.rb', line 26 def initialize(imprt = nil) @import = imprt I18n.locale = import.locale if import&.locale # Should we do this?? here?? end |
Instance Attribute Details
#blob ⇒ Object (readonly)
Returns the value of attribute blob.
24 25 26 |
# File 'app/importers/importo/base_importer.rb', line 24 def blob @blob end |
#import ⇒ Object (readonly)
Returns the value of attribute import.
24 25 26 |
# File 'app/importers/importo/base_importer.rb', line 24 def import @import end |
Class Method Details
.t(key, options = {}) ⇒ Object
37 38 39 40 41 |
# File 'app/importers/importo/base_importer.rb', line 37 def t(key, = {}) if I18n.exists? :"importers.#{name.underscore}#{key}" I18n.t(key, .merge(scope: :"importers.#{name.underscore}")) end end |
Instance Method Details
#state_changed(_import, transition) ⇒ Object
31 32 33 34 |
# File 'app/importers/importo/base_importer.rb', line 31 def state_changed(_import, transition) run_callbacks(transition.to_name) do end end |