Class: ProxyRb::HttpDownloader
- Inherits:
-
Object
- Object
- ProxyRb::HttpDownloader
- Defined in:
- lib/proxy_rb/http_downloader.rb
Overview
Download Content via proxy
Instance Method Summary collapse
-
#initialize(proxy) ⇒ HttpDownloader
constructor
A new instance of HttpDownloader.
- #process(resource) ⇒ Object
Constructor Details
#initialize(proxy) ⇒ HttpDownloader
Returns a new instance of HttpDownloader.
14 15 16 17 |
# File 'lib/proxy_rb/http_downloader.rb', line 14 def initialize(proxy) @downloader = Excon @proxy = proxy end |
Instance Method Details
#process(resource) ⇒ Object
19 20 21 |
# File 'lib/proxy_rb/http_downloader.rb', line 19 def process(resource) resource.content = downloader.get(resource.to_uri, proxy: proxy.to_uri) end |