class EarnShark::Api::Client
Public Class Methods
new(product_id,key)
click to toggle source
initialize the object with the earnshark product id and token provided
# 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
Public Instance Methods
app_dir()
click to toggle source
# File lib/earnshark_sdk/api.rb, line 26 def app_dir @app_dir end
base_url()
click to toggle source
# File lib/earnshark_sdk/api.rb, line 30 def base_url @base_url end
get(url)
click to toggle source
# File lib/earnshark_sdk/api.rb, line 42 def get(url) HTTP.get(url).body end
get_obj()
click to toggle source
# File lib/earnshark_sdk/api.rb, line 34 def get_obj "product_id = #@product_id , token = #@key" end
post(url, body)
click to toggle source
# File lib/earnshark_sdk/api.rb, line 38 def post(url, body) HTTP.post(url, :json => body) end