Module: Pendragon::Errors

Defined in:
lib/pendragon/errors.rb

Overview

Module for creating any error classes.

Defined Under Namespace

Classes: Base

Constant Summary collapse

NotFound =
Base.create(status: 404)
MethodNotAllowed =
Base.create(status: 405) do
  define_method(:parse_payload) do |allows: [], **payload|
    self.headers['Allows'] = allows.join(?,) unless allows.empty?
  end
end