Class: Gemstash::Env::RackMiddleware

Inherits:
Object
  • Object
show all
Defined in:
lib/gemstash/env.rb

Overview

Rack middleware to set the Gemstash::Env for the app.

Instance Method Summary collapse

Constructor Details

#initialize(app, gemstash_env) ⇒ RackMiddleware

Returns a new instance of RackMiddleware.



26
27
28
29
# File 'lib/gemstash/env.rb', line 26

def initialize(app, gemstash_env)
  @app = app
  @gemstash_env = gemstash_env
end

Instance Method Details

#call(env) ⇒ Object



31
32
33
34
# File 'lib/gemstash/env.rb', line 31

def call(env)
  env["gemstash.env"] = @gemstash_env
  @app.call(env)
end