Exception: JSONAPI::Exceptions::InvalidFilterValue
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#filter ⇒ Object
Returns the value of attribute filter.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Error
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(filter, value, error_object_overrides = {}) ⇒ InvalidFilterValue
constructor
A new instance of InvalidFilterValue.
Methods inherited from Error
Constructor Details
#initialize(filter, value, error_object_overrides = {}) ⇒ InvalidFilterValue
Returns a new instance of InvalidFilterValue.
222 223 224 225 226 |
# File 'lib/jsonapi/exceptions.rb', line 222 def initialize(filter, value, error_object_overrides = {}) @filter = filter @value = value super(error_object_overrides) end |
Instance Attribute Details
#filter ⇒ Object
Returns the value of attribute filter.
220 221 222 |
# File 'lib/jsonapi/exceptions.rb', line 220 def filter @filter end |
#value ⇒ Object
Returns the value of attribute value.
220 221 222 |
# File 'lib/jsonapi/exceptions.rb', line 220 def value @value end |
Instance Method Details
#errors ⇒ Object
228 229 230 231 232 233 234 235 236 |
# File 'lib/jsonapi/exceptions.rb', line 228 def errors [create_error_object(code: JSONAPI::INVALID_FILTER_VALUE, status: :bad_request, title: I18n.translate('jsonapi-resources.exceptions.invalid_filter_value.title', default: 'Invalid filter value'), detail: I18n.translate('jsonapi-resources.exceptions.invalid_filter_value.detail', default: "#{value} is not a valid value for #{filter}.", value: value, filter: filter))] end |