Class: AppManager::Client

Inherits:
Object
  • Object
show all
Includes:
Banners, Connection, Plans, HTTParty
Defined in:
lib/app_manager/client.rb,
lib/app_manager/client/plans.rb,
lib/app_manager/client/banners.rb,
lib/app_manager/client/connection.rb

Defined Under Namespace

Modules: Banners, Connection, Plans

Instance Method Summary collapse

Methods included from Plans

#cancel_charge, #discount_used, #get_charge, #get_plan, #get_plans, #get_promotional_discount, #get_related_discounted_plans, #get_remaining_days, #get_status, #has_plan, #store_charge, #sync_charge, #sync_discount_usage_log, #update_charge

Methods included from Banners

#get_banners

Methods included from Connection

#delete, #get, #post, #put

Constructor Details

#initialize(access_token = nil, json_req = false) ⇒ Client

Returns a new instance of Client.



17
18
19
20
21
22
23
24
# File 'lib/app_manager/client.rb', line 17

def initialize(access_token = nil, json_req = false)
  access_token ||= ENV["APP_MANAGER_ACCESS_TOKEN"]
  hostport = ENV['APP_MANAGER_API_URL'] || 'https://app-manager.hulkapps.com'
  self.class.base_uri "#{hostport}/api"
  header = {'token' => "#{access_token}"}
  header.merge!('Content-Type' => 'application/json') if json_req
  self.class.default_options.merge!(headers: header)
end

Instance Method Details

#is_jsonObject



26
27
28
# File 'lib/app_manager/client.rb', line 26

def is_json

end