Class: Hyperdrive::Middleware::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/hyperdrive/middleware/resource.rb

Instance Method Summary collapse

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