Class: Wrappix::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/wrappix/request.rb

Instance Method Summary collapse

Constructor Details

#initialize(url, config = Wrappix.configuration) ⇒ Request

Returns a new instance of Request.



5
6
7
8
# File 'lib/wrappix/request.rb', line 5

def initialize(url, config = Wrappix.configuration)
  @url = url
  @config = config
end

Instance Method Details

#delete(params: {}, headers: {}) ⇒ Object



26
27
28
# File 'lib/wrappix/request.rb', line 26

def delete(params: {}, headers: {})
  handle_response connection.delete(@url, params, headers)
end

#get(params: {}, headers: {}) ⇒ Object



10
11
12
# File 'lib/wrappix/request.rb', line 10

def get(params: {}, headers: {})
  handle_response connection.get(@url, params, headers)
end

#patch(body: {}, headers: {}) ⇒ Object



18
19
20
# File 'lib/wrappix/request.rb', line 18

def patch(body: {}, headers: {})
  handle_response connection.patch(@url, body, headers)
end

#post(body: {}, headers: {}) ⇒ Object



14
15
16
# File 'lib/wrappix/request.rb', line 14

def post(body: {}, headers: {})
  handle_response connection.post(@url, body, headers)
end

#put(body: {}, headers: {}) ⇒ Object



22
23
24
# File 'lib/wrappix/request.rb', line 22

def put(body: {}, headers: {})
  handle_response connection.put(@url, body, headers)
end