Class: Hyperdrive::Middleware::Resource
- Inherits:
-
Object
- Object
- Hyperdrive::Middleware::Resource
- Defined in:
- lib/hyperdrive/middleware/resource.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, resource) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(app, resource) ⇒ Resource
Returns a new instance of Resource.
7 8 9 10 |
# File 'lib/hyperdrive/middleware/resource.rb', line 7 def initialize(app, resource) @app = app @resource = resource end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 |
# File 'lib/hyperdrive/middleware/resource.rb', line 12 def call(env) env['hyperdrive.resource'] = @resource @app.call(env) end |