Class: Rails::Offline
- Inherits:
-
Rack::Offline
- Object
- Rack::Offline
- Rails::Offline
- Defined in:
- lib/rack-offline.rb
Constant Summary
Constants inherited from Rack::Offline
Rack::Offline::UNCACHED_KEY_INTERVAL, Rack::Offline::VERSION
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}, app = Rails.application, &block) ⇒ Offline
constructor
A new instance of Offline.
Methods inherited from Rack::Offline
Constructor Details
#initialize(options = {}, app = Rails.application, &block) ⇒ Offline
Returns a new instance of Offline.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rack-offline.rb', line 10 def initialize( = {}, app = Rails.application, &block) config = app.config root = config.paths['public'].first block = cache_block(Pathname.new(root)) unless block_given? opts = { :cache => config.cache_classes, :root => root, :logger => Rails.logger }.merge() super(opts, &block) end |
Class Method Details
.call(env) ⇒ Object
5 6 7 8 |
# File 'lib/rack-offline.rb', line 5 def self.call(env) @app ||= new @app.call(env) end |