Exception: JSONAPI::Exceptions::InvalidFiltersSyntax

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filters) ⇒ InvalidFiltersSyntax


129
130
131
# File 'lib/jsonapi/exceptions.rb', line 129

def initialize(filters)
  @filters = filters
end

Instance Attribute Details

#filtersObject

Returns the value of attribute filters


128
129
130
# File 'lib/jsonapi/exceptions.rb', line 128

def filters
  @filters
end

Instance Method Details

#errorsObject


133
134
135
136
137
138
139
140
141
# File 'lib/jsonapi/exceptions.rb', line 133

def errors
  [JSONAPI::Error.new(code: JSONAPI::INVALID_FILTERS_SYNTAX,
                      status: :bad_request,
                      title: I18n.translate('jsonapi-resources.exceptions.invalid_filter_syntax.title',
                                            default: 'Invalid filters syntax'),
                      detail: I18n.translate('jsonapi-resources.exceptions.invalid_filter_syntax.detail',
                                             default: "#{filters} is not a valid syntax for filtering.",
                                             filters: filters))]
end