Module: Moneybags::RemoteService

Included in:
YahooCurrencyService
Defined in:
lib/moneybags.rb

Instance Method Summary collapse

Instance Method Details

#initializeObject



11
12
13
# File 'lib/moneybags.rb', line 11

def initialize
  make_request(remote_service_url)
end

#make_request(url) ⇒ Object



15
16
17
18
19
# File 'lib/moneybags.rb', line 15

def make_request(url)
  Net::HTTP.get(URI.parse(url))
rescue Net::HTTPError
  raise ServiceUnavailableError
end