Class: AngieCoreApi::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/angie-core-api/client.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.data(http_method, url, body = {}) ⇒ Object



20
21
22
# File 'lib/angie-core-api/client.rb', line 20

def self.data(http_method, url, body = {})
  self.new.data(http_method, url, body)
end

Instance Method Details

#data(http_method, url, body = {}) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/angie-core-api/client.rb', line 11

def data(http_method, url, body = {})
  case http_method
  when :get
    get(api_url_for(url), headers: api_headers)
  when :post
    post(api_url_for(url), body: body.to_json, headers: api_headers)
  end
end