Class: Calculated::Service
- Inherits:
-
Object
- Object
- Calculated::Service
- Includes:
- HTTParty
- Defined in:
- lib/calculated/service.rb
Instance Method Summary collapse
- #get(path, params = {}) ⇒ Object
-
#initialize(server, api_version, api_key) ⇒ Service
constructor
set the httparty defaults [this obviously makes 1 service] limitation me feels.
- #post(path, params = {}) ⇒ Object
Constructor Details
#initialize(server, api_version, api_key) ⇒ Service
set the httparty defaults [this obviously makes 1 service] limitation me feels
7 8 9 10 |
# File 'lib/calculated/service.rb', line 7 def initialize(server, api_version, api_key) self.class.base_uri "http://#{server}/api/#{api_version}" self.class.headers 'Accept' => 'application/json', "X-CCApiKey" => api_key end |
Instance Method Details
#get(path, params = {}) ⇒ Object
12 13 14 |
# File 'lib/calculated/service.rb', line 12 def get(path, params = {}) perform_request(:get, path, params) end |
#post(path, params = {}) ⇒ Object
16 17 18 |
# File 'lib/calculated/service.rb', line 16 def post(path, params = {}) perform_request(:post, path, params) end |