Module: Tynn::Matchers::InstanceMethods
- Defined in:
- lib/tynn/matchers.rb
Instance Method Summary collapse
-
#default ⇒ Object
Public: A catch-all matcher.
-
#param(key) ⇒ Object
Public: Executes the given block if
keyis present inreq.params.
Instance Method Details
#default ⇒ Object
27 28 29 30 31 |
# File 'lib/tynn/matchers.rb', line 27 def default yield halt(res.finish) end |
#param(key) ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/tynn/matchers.rb', line 51 def param(key) if (v = req[key]) && !v.empty? yield(v) halt(res.finish) end end |