Class: Restify::HTTP Private

Inherits:
Object
  • Object
show all
Defined in:
lib/restify/http.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHTTP

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of HTTP.



9
10
11
# File 'lib/restify/http.rb', line 9

def initialize
  @adapter = self.class.adapter
end

Class Method Details

.adapterObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
# File 'lib/restify/http.rb', line 28

def adapter
  @adapter ||= Restify::Adapter::EM.new
end

Instance Method Details

#request(method, uri, data = nil, _opts = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Request given path with given method.

Returns an obligation that will return a collection or resource or fail with a response error depending on response from server.



21
22
23
24
25
# File 'lib/restify/http.rb', line 21

def request(method, uri, data = nil, _opts = {})
  request = Request.new method: method, uri: uri, data: data

  @adapter.call(request)
end