Class: Frenet::Request

Inherits:
Object
  • Object
show all
Defined in:
app/services/frenet/request.rb

Instance Method Summary collapse

Constructor Details

#initializeRequest

Returns a new instance of Request.



2
# File 'app/services/frenet/request.rb', line 2

def initialize; end

Instance Method Details

#get(path, body = {}) ⇒ Object



4
5
6
7
8
# File 'app/services/frenet/request.rb', line 4

def get(path, body={})
  response = request.get(path, body)
  raise_error(response) unless response.success?
  response.body
end

#post(path, body = {}) ⇒ Object



10
11
12
13
14
# File 'app/services/frenet/request.rb', line 10

def post(path, body={})
  response = request.post(path, body)
  raise_error(response) unless response.success?
  response.body
end