Exception: Pendragon::MethodNotAllowed

Inherits:
ResponseError show all
Defined in:
lib/pendragon/error.rb

Overview

A class for MethodNotAllowed response

Constant Summary collapse

ALLOW =
"Allow".freeze
COMMA =
", ".freeze

Instance Method Summary collapse

Methods inherited from ResponseError

#call, #initialize

Constructor Details

This class inherits a constructor from Pendragon::ResponseError

Instance Method Details

#bodyObject



60
61
62
# File 'lib/pendragon/error.rb', line 60

def body
  @body ||= "Method Not Allowed"
end

#headersObject



64
65
66
67
68
69
# File 'lib/pendragon/error.rb', line 64

def headers
  @headers ||= begin
    super_headers = super
    super_headers.merge!(ALLOW => @args.shift.map{|verb| verb.upcase } * COMMA)
  end
end

#statusObject



56
57
58
# File 'lib/pendragon/error.rb', line 56

def status
  @status ||= 405
end