Class: Useless::Rack::Mongo

Inherits:
Object
  • Object
show all
Defined in:
lib/useless/rack/mongo.rb

Overview

‘Rack::Mongo` adds the Useless.mongo instance to the env as ’useless.mongo’.

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Mongo

Returns a new instance of Mongo.



6
7
8
# File 'lib/useless/rack/mongo.rb', line 6

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
# File 'lib/useless/rack/mongo.rb', line 10

def call(env)
  env['useless.mongo'] = Useless.mongo
  @app.call(env)
end