Class: SeoCache::PopulateCache
- Inherits:
-
Object
- Object
- SeoCache::PopulateCache
- Defined in:
- lib/seo_cache/populate_cache.rb
Instance Method Summary collapse
-
#initialize(host, paths, options = {}) ⇒ PopulateCache
constructor
A new instance of PopulateCache.
- #perform ⇒ Object
Constructor Details
#initialize(host, paths, options = {}) ⇒ PopulateCache
Returns a new instance of PopulateCache.
8 9 10 11 12 13 14 15 16 |
# File 'lib/seo_cache/populate_cache.rb', line 8 def initialize(host, paths, = {}) @host = host @paths = paths @page_render = PageRender.new @page_caching = PageCaching.new @force_cache = .fetch(:force_cache, false) @with_locale_keys = .fetch(:with_locale_keys, false) end |
Instance Method Details
#perform ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/seo_cache/populate_cache.rb', line 18 def perform if @with_locale_keys @paths.each do |locale, paths| paths.each do |path| generate_cache(path, locale) end end else @paths.each do |path| generate_cache(path) end end ensure @page_render.close_connection end |