Module: Barometer::Utils::Get

Defined in:
lib/barometer/utils/get.rb

Class Method Summary collapse

Class Method Details

.call(url, query = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/barometer/utils/get.rb', line 6

def self.call(url, query={})
  address = Barometer::Utils::Address.new(url, query)

  http = HTTPClient.new
  http.receive_timeout = Barometer.timeout
  http.get(address)
rescue HTTPClient::TimeoutError
  raise Barometer::TimeoutError
end