Class: Xplenty::Kensa::ApiCheck

Inherits:
Check
  • Object
show all
Defined in:
lib/xplenty/kensa/check.rb

Instance Attribute Summary

Attributes inherited from Check

#data, #screen

Instance Method Summary collapse

Methods inherited from Check

#call, #check, #env, #error, #initialize, #run, #test, #to_proc, #url

Constructor Details

This class inherits a constructor from Xplenty::Kensa::Check

Instance Method Details

#base_pathObject



231
232
233
234
235
236
237
# File 'lib/xplenty/kensa/check.rb', line 231

def base_path
  if data['api'][env].is_a? Hash
    URI.parse(data['api'][env]['base_url']).path
  else
    '/xplenty/resources'
  end
end

#credentialsObject



243
244
245
# File 'lib/xplenty/kensa/check.rb', line 243

def credentials
  [ data['id'], data['api']['password'] ]
end

#xplenty_idObject



239
240
241
# File 'lib/xplenty/kensa/check.rb', line 239

def xplenty_id
  "app#{rand(10000)}@kensa.xplenty.com"
end