Module: Bearcat::Client::OutcomeImports

Defined in:
lib/bearcat/client/outcome_imports.rb

Instance Method Summary collapse

Instance Method Details

#import_outcomes(file_path, params = {}) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/bearcat/client/outcome_imports.rb', line 5

def import_outcomes(file_path, params={})
  params = params.with_indifferent_access
  params['attachment'] = Faraday::UploadIO.new(file_path, 'text/csv')
  url = "api/v1/#{outcome_import_context_slug(params)}"
  url += "group/#{params[:group]}/" if params[:group].present?
  params.delete(:group)
  post(url, params)
end

#outcome_import_created_group_ids(id, params = {}) ⇒ Object



19
20
21
22
# File 'lib/bearcat/client/outcome_imports.rb', line 19

def outcome_import_created_group_ids(id, params={})
  params = params.with_indifferent_access
  get("api/v1/#{outcome_import_context_slug(params)}#{id}/created_group_ids", params)
end

#outcome_import_status(id, params = {}) ⇒ Object



14
15
16
17
# File 'lib/bearcat/client/outcome_imports.rb', line 14

def outcome_import_status(id, params={})
  params = params.with_indifferent_access
  get("api/v1/#{outcome_import_context_slug(params)}#{id}", params)
end