Class: CmAdmin::Models::Importer
- Inherits:
-
Object
- Object
- CmAdmin::Models::Importer
- Defined in:
- lib/cm_admin/models/importer.rb
Constant Summary collapse
- VALID_IMPORTER_TYPES =
[:csv_importer, :custom_importer]
Instance Attribute Summary collapse
-
#class_name ⇒ Object
Returns the value of attribute class_name.
-
#importer_type ⇒ Object
Returns the value of attribute importer_type.
Instance Method Summary collapse
-
#initialize(class_name, importer_type = :csv_importer) ⇒ Importer
constructor
A new instance of Importer.
Constructor Details
#initialize(class_name, importer_type = :csv_importer) ⇒ Importer
Returns a new instance of Importer.
9 10 11 12 13 |
# File 'lib/cm_admin/models/importer.rb', line 9 def initialize(class_name, importer_type=:csv_importer) raise ArgumentError, "Kindly select a valid importer type like #{VALID_IMPORTER_TYPES.sort.to_sentence(last_word_connector: ', or ')} instead of #{importer_type}" unless VALID_IMPORTER_TYPES.include?(importer_type.to_sym) @class_name = class_name @importer_type = importer_type end |
Instance Attribute Details
#class_name ⇒ Object
Returns the value of attribute class_name.
5 6 7 |
# File 'lib/cm_admin/models/importer.rb', line 5 def class_name @class_name end |
#importer_type ⇒ Object
Returns the value of attribute importer_type.
5 6 7 |
# File 'lib/cm_admin/models/importer.rb', line 5 def importer_type @importer_type end |