Class: FuelSurcharge::HTTPRequest
- Inherits:
-
Object
- Object
- FuelSurcharge::HTTPRequest
- Defined in:
- lib/fuel_surcharge/http_request.rb
Instance Method Summary collapse
-
#initialize(url) ⇒ HTTPRequest
constructor
A new instance of HTTPRequest.
- #response ⇒ Object
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
#response ⇒ Object
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 |