Class: Sapp::Handler
- Inherits:
-
Object
- Object
- Sapp::Handler
- Defined in:
- lib/sapp/handler.rb
Overview
In charge of checking for a route match and setting the status, contains the unwrap method to call the handler proc in the context of this class. We need access to #params and #status
Instance Method Summary collapse
-
#initialize(handler, request, keys) ⇒ Handler
constructor
A new instance of Handler.
- #status ⇒ Object
- #unwrap ⇒ Object
Constructor Details
#initialize(handler, request, keys) ⇒ Handler
Returns a new instance of Handler.
9 10 11 12 13 |
# File 'lib/sapp/handler.rb', line 9 def initialize handler, request, keys @handler = handler @request = request @keys = keys end |
Instance Method Details
#status ⇒ Object
20 21 22 |
# File 'lib/sapp/handler.rb', line 20 def status @status end |
#unwrap ⇒ Object
15 16 17 18 |
# File 'lib/sapp/handler.rb', line 15 def unwrap add_keys_to_params instance_eval(&handler) end |