Class: RackEnvironment

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

Defined Under Namespace

Classes: Task

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}) ⇒ RackEnvironment

Returns a new instance of RackEnvironment.



5
6
7
8
# File 'lib/rack_environment.rb', line 5

def initialize(app, options={})
  @app     = app
  @options = options
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



3
4
5
# File 'lib/rack_environment.rb', line 3

def app
  @app
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/rack_environment.rb', line 3

def options
  @options
end

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
# File 'lib/rack_environment.rb', line 10

def call(env)
  update_environment!
  app.call(env)
end

#update_environment!Object



15
16
17
18
19
# File 'lib/rack_environment.rb', line 15

def update_environment!
  environment.each do |key, value|
    ENV[key] = value
  end
end