Class: RichUrls::UrlFetcher
- Inherits:
-
Object
- Object
- RichUrls::UrlFetcher
- Defined in:
- lib/url_fetcher.rb
Defined Under Namespace
Classes: UrlFetcherError
Constant Summary collapse
- DEFAULT_TIMEOUT =
seconds
10
Class Method Summary collapse
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(url, attributes, browser, cache_time) ⇒ UrlFetcher
constructor
A new instance of UrlFetcher.
Constructor Details
#initialize(url, attributes, browser, cache_time) ⇒ UrlFetcher
Returns a new instance of UrlFetcher.
20 21 22 23 24 25 |
# File 'lib/url_fetcher.rb', line 20 def initialize(url, attributes, browser, cache_time) @url = url @attributes = attributes @browser = browser @cache_time = cache_time end |
Class Method Details
.fetch(url, attributes = [], browser: PatronBrowser.new, cache_time: nil) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/url_fetcher.rb', line 9 def self.fetch( url, attributes = [], browser: PatronBrowser.new, cache_time: nil ) new(url, attributes, browser, cache_time).fetch end |