Class: Penthouse::App
- Inherits:
-
Object
- Object
- Penthouse::App
- Defined in:
- lib/penthouse/app.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#router ⇒ Object
readonly
Returns the value of attribute router.
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
Instance Method Summary collapse
- #call(env) ⇒ void
-
#initialize(app, router: Penthouse.configuration.router, runner: Penthouse.configuration.runner) ⇒ App
constructor
A new instance of App.
Constructor Details
#initialize(app, router: Penthouse.configuration.router, runner: Penthouse.configuration.runner) ⇒ App
Returns a new instance of App.
22 23 24 25 26 |
# File 'lib/penthouse/app.rb', line 22 def initialize(app, router: Penthouse.configuration.router, runner: Penthouse.configuration.runner) self.app = app self.router = router self.runner = runner end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
16 17 18 |
# File 'lib/penthouse/app.rb', line 16 def app @app end |
#router ⇒ Object
Returns the value of attribute router.
16 17 18 |
# File 'lib/penthouse/app.rb', line 16 def router @router end |
#runner ⇒ Object
Returns the value of attribute runner.
16 17 18 |
# File 'lib/penthouse/app.rb', line 16 def runner @runner end |
Instance Method Details
#call(env) ⇒ void
This method returns an undefined value.
31 32 33 34 35 36 |
# File 'lib/penthouse/app.rb', line 31 def call(env) request = Rack::Request.new(env) runner.call(router.call(request)) do app.call(env) end end |