Module: Prefetcher
- Defined in:
- lib/prefetcher.rb,
lib/prefetcher/version.rb,
lib/prefetcher/http_fetcher.rb,
lib/prefetcher/http_memoizer.rb
Defined Under Namespace
Classes: HttpFetcher, HttpMemoizer
Constant Summary collapse
- VERSION =
"0.0.2"
Class Method Summary collapse
- .redis_connection ⇒ Object
- .redis_connection=(conn) ⇒ Object
-
.update_all(options = {}) ⇒ Object
Updates all memoized requests.
Class Method Details
.redis_connection ⇒ Object
19 20 21 |
# File 'lib/prefetcher.rb', line 19 def self.redis_connection @redis_connection ||= Redis.new end |
.redis_connection=(conn) ⇒ Object
23 24 25 |
# File 'lib/prefetcher.rb', line 23 def self.redis_connection=(conn) @redis_connection = conn end |
.update_all(options = {}) ⇒ Object
Updates all memoized requests
13 14 15 16 17 |
# File 'lib/prefetcher.rb', line 13 def self.update_all( = {}) HttpMemoizer.new().get_list.each do |url| HttpFetcher.new(.merge(url: url)).fetch end end |