Class: HttpClient

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

Instance Method Summary collapse

Constructor Details

#initialize(protocol, host, port, namespace = nil) ⇒ HttpClient

Returns a new instance of HttpClient.



6
7
8
9
10
11
12
# File 'lib/http_client.rb', line 6

def initialize(protocol, host, port, namespace=nil)
  @http = Net::HTTP.new(host, port)
  @protocol = protocol
  @host = host
  @port = port
  @namespace = namespace
end

Instance Method Details

#send_request(method, resource, headers = nil, data = nil, params = nil) ⇒ Object



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

def send_request(method, resource, headers=nil, data=nil, params=nil)
  return self.send(method.to_s.downcase, headers, resource, data, params)
end