Class: FuelSurcharge::HTTPRequest

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

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ HTTPRequest

Returns a new instance of HTTPRequest.



7
8
9
# File 'lib/fuel_surcharge/http_request.rb', line 7

def initialize(url)
  @url = url
end

Instance Method Details

#responseObject



11
12
13
14
15
# File 'lib/fuel_surcharge/http_request.rb', line 11

def response
  ::HTTP.timeout(10).get(@url)
rescue HTTP::Error
  ""
end