Class: Junior::Router
- Inherits:
-
Object
- Object
- Junior::Router
- Defined in:
- lib/junior/router.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#router ⇒ Object
readonly
Returns the value of attribute router.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, router) ⇒ Router
constructor
A new instance of Router.
Constructor Details
#initialize(app, router) ⇒ Router
Returns a new instance of Router.
7 8 9 |
# File 'lib/junior/router.rb', line 7 def initialize(app, router) @app, @router = app, router end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
5 6 7 |
# File 'lib/junior/router.rb', line 5 def app @app end |
#router ⇒ Object (readonly)
Returns the value of attribute router.
5 6 7 |
# File 'lib/junior/router.rb', line 5 def router @router end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 |
# File 'lib/junior/router.rb', line 11 def call(env) @router.call(env) @app.call(env) end |