Class: Theme::Middleware
- Inherits:
-
Object
- Object
- Theme::Middleware
- Defined in:
- lib/theme/middleware.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Instance Method Summary collapse
- #call(env) ⇒ Object
- #call!(env) ⇒ Object
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app) ⇒ Middleware
Returns a new instance of Middleware.
8 9 10 |
# File 'lib/theme/middleware.rb', line 8 def initialize(app) @app = app end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
6 7 8 |
# File 'lib/theme/middleware.rb', line 6 def app @app end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
6 7 8 |
# File 'lib/theme/middleware.rb', line 6 def env @env end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 |
# File 'lib/theme/middleware.rb', line 12 def call env dup.call! env end |
#call!(env) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/theme/middleware.rb', line 16 def call! env @env = env if component_path render_component else res end end |