Sha256: b89e54923d4b2cbfe59ed89ec5745ac6de17be7a1fe6d80a2542f52abbbcb455
Contents?: true
Size: 554 Bytes
Versions: 3
Compression:
Stored size: 554 Bytes
Contents
module Brandspotter class Client def base_uri(path='/') "http://brandspotter.herokuapp.com/api#{path}?user_token=#{self.user_token}&" end def configure_payload(path, opts={}) base_uri(path) + opts.to_params end def get_request(url) JSON.parse RestClient::Request.execute(method: :get, url: url) end def post_request(path, opts) JSON.parse RestClient.post(base_uri(path), opts) end def delete_request(path) JSON.parse RestClient::Request.execute(method: :delete, url: base_uri(path)) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
brandspotter-1.0.2 | lib/brandspotter/client/endpoints.rb |
brandspotter-1.0.1 | lib/brandspotter/client/endpoints.rb |
brandspotter-1.0.0 | lib/brandspotter/client/endpoints.rb |