Exception: JSONAPI::Exceptions::FilterNotAllowed

Inherits:
Error
  • Object
show all
Defined in:
lib/jsonapi/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filter) ⇒ FilterNotAllowed

Returns a new instance of FilterNotAllowed.



61
62
63
# File 'lib/jsonapi/exceptions.rb', line 61

def initialize(filter)
  @filter = filter
end

Instance Attribute Details

#filterObject

Returns the value of attribute filter.



60
61
62
# File 'lib/jsonapi/exceptions.rb', line 60

def filter
  @filter
end

Instance Method Details

#errorsObject



65
66
67
68
69
70
# File 'lib/jsonapi/exceptions.rb', line 65

def errors
  [JSONAPI::Error.new(code: JSONAPI::FILTER_NOT_ALLOWED,
                       status: :bad_request,
                       title: 'Filter not allowed',
                       detail: "#{filter} is not allowed.")]
end