Exception: Core::Service::MethodNotAllowed
- Defined in:
- app/api/core/service.rb
Instance Method Summary collapse
- #api_error(response) ⇒ Object
-
#initialize(allowed_http_verbs) ⇒ MethodNotAllowed
constructor
A new instance of MethodNotAllowed.
Methods included from Error::Behaviour
Constructor Details
#initialize(allowed_http_verbs) ⇒ MethodNotAllowed
Returns a new instance of MethodNotAllowed.
37 38 39 40 |
# File 'app/api/core/service.rb', line 37 def initialize(allowed_http_verbs) super('HTTP verb was not allowed!') @allowed = Array(allowed_http_verbs).map(&:to_s).map(&:upcase).join(',') end |
Instance Method Details
#api_error(response) ⇒ Object
45 46 47 48 |
# File 'app/api/core/service.rb', line 45 def api_error(response) response.headers('Allow' => @allowed) super end |