Class: EarnShark::Api::Client
- Inherits:
-
Object
- Object
- EarnShark::Api::Client
- Includes:
- EarnShark::Account, License, Request, Subscription
- Defined in:
- lib/earnshark_sdk/api.rb
Constant Summary
Constants included from Request
Request::APP_DIR, Request::BASE_URL
Instance Method Summary collapse
- #app_dir ⇒ Object
- #base_url ⇒ Object
- #get(url) ⇒ Object
- #get_obj ⇒ Object
-
#initialize(product_id, key) ⇒ Client
constructor
initialize the object with the earnshark product id and token provided.
- #post(url, body) ⇒ Object
Methods included from Subscription
#get_payment_url, #new_subscription, #renew_subscription, #renewed_subscription_notifier
Methods included from License
#get_all_licenses, #get_license_information
Methods included from EarnShark::Account
#get_account_information, #get_account_payments
Constructor Details
Instance Method Details
#app_dir ⇒ Object
26 27 28 |
# File 'lib/earnshark_sdk/api.rb', line 26 def app_dir @app_dir end |
#base_url ⇒ Object
30 31 32 |
# File 'lib/earnshark_sdk/api.rb', line 30 def base_url @base_url end |
#get(url) ⇒ Object
42 43 44 |
# File 'lib/earnshark_sdk/api.rb', line 42 def get(url) HTTP.get(url).body end |
#get_obj ⇒ Object
34 35 36 |
# File 'lib/earnshark_sdk/api.rb', line 34 def get_obj "product_id = #@product_id , token = #@key" end |
#post(url, body) ⇒ Object
38 39 40 |
# File 'lib/earnshark_sdk/api.rb', line 38 def post(url, body) HTTP.post(url, :json => body) end |