7
8
9
10
11
12
13
14
|
# File 'lib/mugshot/http_storage.rb', line 7
def read(id)
url = URI.parse(@url_resolver.call(id))
res = Net::HTTP.start(url.host, url.port) {|http| http.get(url.path)}
return nil unless res.code.to_i == 200
Mugshot::Image.new(res.body)
end
|