Class: Importable::Resource

Inherits:
Importer
  • Object
show all
Defined in:
app/models/importable/resource.rb

Instance Attribute Summary

Attributes inherited from Importer

#import_params

Attributes included from MultiStep::ImportHelpers

#current_step

Instance Method Summary collapse

Methods inherited from Importer

#import!, #imported_items_ready?, #invalid_items, #mapper, #mapper_class, #mapper_name_with_module, #plural_mapper_class, #singular_mapper_class

Methods included from MultiStep::ImportHelpers

#first_step?, #last_step?, #next_step, #previous_step, #steps

Instance Method Details

#resource_classObject



12
13
14
# File 'app/models/importable/resource.rb', line 12

def resource_class
  mapper_name_with_module.camelize.constantize
end

#rowsObject



3
4
5
6
7
8
9
10
# File 'app/models/importable/resource.rb', line 3

def rows
  method = import_params.delete('method')
  if method
    resource_class.get(method.to_sym, import_params)
  else
    resource_class.all(params: import_params)
  end
end