Module: Tynn::AllMethods::InstanceMethods
- Defined in:
- lib/tynn/all_methods.rb
Instance Method Summary collapse
-
#head ⇒ Object
Public: Executes the given block if the request method is
HEAD. -
#options ⇒ Object
Public: Executes the given block if the request method is
OPTIONS.
Instance Method Details
#head ⇒ Object
Public: Executes the given block if the request method is HEAD.
Examples
Tynn.define do
head do
res.status = 201
end
end
23 24 25 26 27 28 29 |
# File 'lib/tynn/all_methods.rb', line 23 def head if root? && req.head? yield halt(res.finish) end end |
#options ⇒ Object
Public: Executes the given block if the request method is OPTIONS.
Examples
Tynn.define do
do
res.status = 405
end
end
41 42 43 44 45 46 47 |
# File 'lib/tynn/all_methods.rb', line 41 def if root? && req. yield halt(res.finish) end end |