Exception: JSONAPI::Exceptions::InvalidFilterValue

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filter, value) ⇒ InvalidFilterValue



86
87
88
89
# File 'lib/jsonapi/exceptions.rb', line 86

def initialize(filter, value)
  @filter = filter
  @value = value
end

Instance Attribute Details

#filterObject

Returns the value of attribute filter.



85
86
87
# File 'lib/jsonapi/exceptions.rb', line 85

def filter
  @filter
end

#valueObject

Returns the value of attribute value.



85
86
87
# File 'lib/jsonapi/exceptions.rb', line 85

def value
  @value
end

Instance Method Details

#errorsObject



91
92
93
94
95
96
# File 'lib/jsonapi/exceptions.rb', line 91

def errors
  [JSONAPI::Error.new(code: JSONAPI::INVALID_FILTER_VALUE,
                       status: :bad_request,
                       title: 'Invalid filter value',
                       detail: "#{value} is not a valid value for #{filter}.")]
end