Exception: Wurk::API::Validation::Invalid

Inherits:
StandardError
  • Object
show all
Defined in:
lib/wurk/api/validation.rb

Overview

Carries the problem it should be rendered as, so a route rescues one class and renders whatever it was handed instead of mapping message text back onto a status code.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(detail, type: Problem::INVALID_REQUEST, status: 400, **extra) ⇒ Invalid

Returns a new instance of Invalid.



29
30
31
32
33
34
# File 'lib/wurk/api/validation.rb', line 29

def initialize(detail, type: Problem::INVALID_REQUEST, status: 400, **extra)
  super(detail)
  @type = type
  @status = status
  @extra = extra
end

Instance Attribute Details

#extraObject (readonly)

Returns the value of attribute extra.



27
28
29
# File 'lib/wurk/api/validation.rb', line 27

def extra
  @extra
end

#statusObject (readonly)

Returns the value of attribute status.



27
28
29
# File 'lib/wurk/api/validation.rb', line 27

def status
  @status
end

#typeObject (readonly)

Returns the value of attribute type.



27
28
29
# File 'lib/wurk/api/validation.rb', line 27

def type
  @type
end