Class: Goldfinger::Request

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

Instance Method Summary collapse

Constructor Details

#initialize(request_method, path, options = {}) ⇒ Request

Returns a new instance of Request.



6
7
8
9
10
# File 'lib/goldfinger/request.rb', line 6

def initialize(request_method, path, options = {})
  @request_method = request_method
  @uri            = Addressable::URI.parse(path)
  @options        = options
end

Instance Method Details

#performObject



12
13
14
15
# File 'lib/goldfinger/request.rb', line 12

def perform
  response = http_client.request(@request_method, @uri.to_s, @options)
  [response.headers, response.body]
end