Exception: QueryHelper::InvalidSortParamError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/query_helper/invalid_sort_param_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg = 'Invalid sort param', sort_string = '') ⇒ InvalidSortParamError

Returns a new instance of InvalidSortParamError.



6
7
8
9
# File 'lib/query_helper/invalid_sort_param_error.rb', line 6

def initialize(msg='Invalid sort param', sort_string='')
  @sort_string = sort_string
  super(msg)
end

Instance Attribute Details

#sort_stringObject (readonly)

Returns the value of attribute sort_string.



4
5
6
# File 'lib/query_helper/invalid_sort_param_error.rb', line 4

def sort_string
  @sort_string
end

Instance Method Details

#as_jsonObject



11
12
13
14
15
16
# File 'lib/query_helper/invalid_sort_param_error.rb', line 11

def as_json
  {
    'error' => message,
    'sort_param' => sort_string
  }
end