Class: Himari::Middlewares::Config
- Inherits:
-
Object
- Object
- Himari::Middlewares::Config
- Defined in:
- lib/himari/middlewares/config.rb
Constant Summary collapse
- RACK_KEY =
'himari.config'
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, kwargs = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
13 14 15 |
# File 'lib/himari/middlewares/config.rb', line 13 def app @app end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
13 14 15 |
# File 'lib/himari/middlewares/config.rb', line 13 def config @config end |
Instance Method Details
#call(env) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/himari/middlewares/config.rb', line 15 def call(env) env[RACK_KEY] = config unless config.preserve_rack_logger env['rack.logger'] = config.logger end @app.call(env) end |