Exception: JSONAPI::Exceptions::FilterNotAllowed
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#filter ⇒ Object
Returns the value of attribute filter.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(filter) ⇒ FilterNotAllowed
constructor
A new instance of FilterNotAllowed.
Constructor Details
#initialize(filter) ⇒ FilterNotAllowed
Returns a new instance of FilterNotAllowed.
146 147 148 |
# File 'lib/jsonapi/exceptions.rb', line 146 def initialize(filter) @filter = filter end |
Instance Attribute Details
#filter ⇒ Object
Returns the value of attribute filter.
145 146 147 |
# File 'lib/jsonapi/exceptions.rb', line 145 def filter @filter end |
Instance Method Details
#errors ⇒ Object
150 151 152 153 154 155 156 157 |
# File 'lib/jsonapi/exceptions.rb', line 150 def errors [JSONAPI::Error.new(code: JSONAPI::FILTER_NOT_ALLOWED, status: :bad_request, title: I18n.translate('jsonapi-resources.exceptions.filter_not_allowed.title', default: 'Filter not allowed'), detail: I18n.translate('jsonapi-resources.exceptions.filter_not_allowed.detail', default: "#{filter} is not allowed.", filter: filter))] end |