Class: Chewy::Search::Parameters::Order
- Defined in:
- lib/chewy/search/parameters/order.rb
Overview
Sort parameter storage. Stores a hash of fields with the nil
key if no options for the field were specified. Normalizer
accepts an array of any hash-string-symbols combinations, or a hash.
Instance Attribute Summary
Attributes inherited from Storage
Instance Method Summary collapse
-
#render ⇒ {Symbol => Array<Hash, String, Symbol>}
Size requires specialized rendering logic, it should return an array to satisfy ES.
-
#update!(other_value) ⇒ Object
Merges two hashes.
Methods inherited from Storage
#==, #initialize, #merge!, #replace!
Constructor Details
This class inherits a constructor from Chewy::Search::Parameters::Storage
Instance Method Details
#render ⇒ {Symbol => Array<Hash, String, Symbol>}
Size requires specialized rendering logic, it should return an array to satisfy ES.
28 29 30 31 32 |
# File 'lib/chewy/search/parameters/order.rb', line 28 def render return if value.blank? {sort: value} end |
#update!(other_value) ⇒ Object
Merges two hashes.
19 20 21 |
# File 'lib/chewy/search/parameters/order.rb', line 19 def update!(other_value) value.concat(normalize(other_value)) end |