Class: RackEnvironment
- Inherits:
-
Object
- Object
- RackEnvironment
- Defined in:
- lib/rack_environment.rb
Defined Under Namespace
Classes: Task
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ RackEnvironment
constructor
A new instance of RackEnvironment.
- #update_environment! ⇒ Object
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, ={}) @app = app @options = end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
3 4 5 |
# File 'lib/rack_environment.rb', line 3 def app @app end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/rack_environment.rb', line 3 def @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 |