Module: WeatherJp::Adapter::Reader

Defined in:
lib/weather_jp/adapter.rb

Class Method Summary collapse

Class Method Details

.read(url) ⇒ Object



81
82
83
84
85
# File 'lib/weather_jp/adapter.rb', line 81

def read(url)
  open(url).read
rescue OpenURI::HTTPError => e
  raise ServiceUnavailable.new("status=#{e.message[0..-2]}")
end