Class: MHVAC::Client
- Inherits:
-
Common::Client::Base
- Object
- Common::Client::Base
- MHVAC::Client
- Defined in:
- lib/mhv_ac/client.rb
Overview
Core class responsible for MHVAC API interface operations
Instance Method Summary collapse
-
#get_countries ⇒ Hash
Get a list of available countries (used for registraion).
-
#get_states ⇒ Hash
Get a list of available states (used for registration).
-
#post_register(params) ⇒ Hash
Create an MHV account.
-
#post_upgrade(params) ⇒ Hash
Upgrade an MHV account.
Methods inherited from Common::Client::Base
configuration, #raise_backend_exception
Methods included from SentryLogging
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger
Instance Method Details
#get_countries ⇒ Hash
Note:
These two lists (state and country) should be cached for any given day.
Get a list of available countries (used for registraion)
49 50 51 |
# File 'lib/mhv_ac/client.rb', line 49 def get_countries perform(:get, 'enum/countries', nil, nonauth_headers).body end |
#get_states ⇒ Hash
Note:
These two lists (state and country) should be cached for any given day
Get a list of available states (used for registration)
40 41 42 |
# File 'lib/mhv_ac/client.rb', line 40 def get_states perform(:get, 'enum/states', nil, nonauth_headers).body end |
#post_register(params) ⇒ Hash
Create an MHV account
20 21 22 23 |
# File 'lib/mhv_ac/client.rb', line 20 def post_register(params) form = MHVAC::RegistrationForm.new(params) perform(:post, 'account/register', form.mhv_params, nonauth_headers).body end |
#post_upgrade(params) ⇒ Hash
Upgrade an MHV account
30 31 32 33 |
# File 'lib/mhv_ac/client.rb', line 30 def post_upgrade(params) form = MHVAC::UpgradeForm.new(params) perform(:post, 'account/upgrade', form.mhv_params, nonauth_headers).body end |