Exception: Common::Exceptions::InvalidSortCriteria
- Defined in:
- lib/common/exceptions/invalid_sort_criteria.rb
Overview
InvalidSortCriteria - sort criteria is invalid
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#sort_criteria ⇒ Object
readonly
Returns the value of attribute sort_criteria.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(resource, sort_criteria) ⇒ InvalidSortCriteria
constructor
A new instance of InvalidSortCriteria.
Methods inherited from BaseError
#i18n_data, #i18n_field, #i18n_interpolated, #i18n_key, #log_to_sentry?, #message, #sentry_type, #status_code
Constructor Details
#initialize(resource, sort_criteria) ⇒ InvalidSortCriteria
Returns a new instance of InvalidSortCriteria.
12 13 14 15 |
# File 'lib/common/exceptions/invalid_sort_criteria.rb', line 12 def initialize(resource, sort_criteria) @sort_criteria = sort_criteria @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
10 11 12 |
# File 'lib/common/exceptions/invalid_sort_criteria.rb', line 10 def resource @resource end |
#sort_criteria ⇒ Object (readonly)
Returns the value of attribute sort_criteria.
10 11 12 |
# File 'lib/common/exceptions/invalid_sort_criteria.rb', line 10 def sort_criteria @sort_criteria end |
Instance Method Details
#errors ⇒ Object
17 18 19 |
# File 'lib/common/exceptions/invalid_sort_criteria.rb', line 17 def errors Array(SerializableError.new(i18n_interpolated(detail: { sort_criteria: @sort_criteria, resource: @resource }))) end |