Class: Rack::HerokuEnv

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

Constant Summary collapse

VERSION =
'0.1.1'

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ HerokuEnv

Returns a new instance of HerokuEnv.



5
6
7
# File 'lib/rack/heroku_env.rb', line 5

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/rack/heroku_env.rb', line 9

def call(env)
  response = @app.call(env)

  heroku_vars(env).each do |variable_name|
    response[1][header_name_for(variable_name)] = env[variable_name]
  end

  response
end