Class: Rack::NonCache::Engine
- Inherits:
-
Object
- Object
- Rack::NonCache::Engine
- Defined in:
- lib/rack/noncache/engine.rb
Instance Attribute Summary collapse
-
#blacklist ⇒ Object
Returns the value of attribute blacklist.
-
#whitelist ⇒ Object
Returns the value of attribute whitelist.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(backend, options) {|_self| ... } ⇒ Engine
constructor
A new instance of Engine.
Constructor Details
#initialize(backend, options) {|_self| ... } ⇒ Engine
Returns a new instance of Engine.
8 9 10 11 12 13 |
# File 'lib/rack/noncache/engine.rb', line 8 def initialize(backend, ) @backend = backend @whitelist = [:whitelist] @blacklist = [:blacklist] yield self if block_given? end |
Instance Attribute Details
#blacklist ⇒ Object
Returns the value of attribute blacklist.
6 7 8 |
# File 'lib/rack/noncache/engine.rb', line 6 def blacklist @blacklist end |
#whitelist ⇒ Object
Returns the value of attribute whitelist.
6 7 8 |
# File 'lib/rack/noncache/engine.rb', line 6 def whitelist @whitelist end |
Instance Method Details
#call(env) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/rack/noncache/engine.rb', line 15 def call(env) # execute the request using our backend status, headers, response = @backend.call(env) uri = env['REQUEST_URI'] filters.each { |filter| filter.apply(headers) } if target_path? uri [status, headers, response] end |