Class: EarnShark::Api::Client
Constant Summary
Constants included
from Request
Request::APP_DIR, Request::BASE_URL
Instance Method Summary
collapse
Methods included from License
#get_all_licenses, #get_license_information
#get_account_information, #get_account_payments
Constructor Details
#initialize(product_id, key) ⇒ Client
initialize the object with the earnshark product id and token provided
20
21
22
23
24
|
# File 'lib/earnshark_sdk/api.rb', line 20
def initialize(product_id,key)
@product_id, @key = product_id , key
@base_url = BASE_URL
@app_dir = APP_DIR
end
|
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
|