Class: Shaf::Router::MethodNotAllowedResponder

Inherits:
Object
  • Object
show all
Defined in:
lib/shaf/router.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_methodsObject (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

#allowedObject



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