Class: Shaf::Router::MethodNotAllowedResponder
- Inherits:
-
Object
- Object
- Shaf::Router::MethodNotAllowedResponder
- Defined in:
- lib/shaf/router.rb
Instance Attribute Summary collapse
-
#supported_methods ⇒ Object
readonly
Returns the value of attribute supported_methods.
Instance Method Summary collapse
- #allowed ⇒ Object
- #call(env) ⇒ Object
-
#initialize(supported_methods) ⇒ MethodNotAllowedResponder
constructor
A new instance of MethodNotAllowedResponder.
Constructor Details
#initialize(supported_methods) ⇒ MethodNotAllowedResponder
Returns a new instance of MethodNotAllowedResponder.
12 13 14 |
# File 'lib/shaf/router.rb', line 12 def initialize(supported_methods) @supported_methods = supported_methods end |
Instance Attribute Details
#supported_methods ⇒ Object (readonly)
Returns the value of attribute supported_methods.
10 11 12 |
# File 'lib/shaf/router.rb', line 10 def supported_methods @supported_methods end |
Instance Method Details
#allowed ⇒ Object
16 17 18 |
# File 'lib/shaf/router.rb', line 16 def allowed supported_methods.join(', ') end |
#call(env) ⇒ Object
20 21 22 |
# File 'lib/shaf/router.rb', line 20 def call(env) [405, {'Allow' => allowed}, ''] end |