Class: BlueConductor::HTTP::Request
- Inherits:
-
Object
- Object
- BlueConductor::HTTP::Request
- Defined in:
- lib/blue_conductor/http/request.rb
Class Method Summary collapse
Class Method Details
.fetch(url) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/blue_conductor/http/request.rb', line 5 def self.fetch(url) response = Net::HTTP.get_response(URI.parse(url)) if response.code == '301' parse(response['location']) else parse(url) end end |
.parse(location) ⇒ Object
15 16 17 |
# File 'lib/blue_conductor/http/request.rb', line 15 def self.parse(location) Net::HTTP.get(URI.parse(location)) end |