Class: GarageClient::Response::Cacheable
- Inherits:
-
Faraday::Response::Middleware
- Object
- Faraday::Response::Middleware
- GarageClient::Response::Cacheable
- Defined in:
- lib/garage_client/response/cacheable.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, args) ⇒ Cacheable
constructor
A new instance of Cacheable.
Constructor Details
#initialize(app, args) ⇒ Cacheable
Returns a new instance of Cacheable.
8 9 10 11 12 |
# File 'lib/garage_client/response/cacheable.rb', line 8 def initialize(app, args) super(app) @cacher_class = args[:cacher] validate! end |
Instance Method Details
#call(env) ⇒ Object
14 15 16 |
# File 'lib/garage_client/response/cacheable.rb', line 14 def call(env) @cacher_class.new(env).call { @app.call(env) } end |