Class: Arelastic::Searches::Sort
- Inherits:
-
Search
- Object
- Nodes::Node
- Search
- Arelastic::Searches::Sort
- Defined in:
- lib/arelastic/searches/sort.rb
Instance Attribute Summary collapse
-
#sorts ⇒ Object
readonly
Returns the value of attribute sorts.
Instance Method Summary collapse
- #as_elastic ⇒ Object
-
#initialize(sorts) ⇒ Sort
constructor
A new instance of Sort.
Methods inherited from Nodes::Node
#==, #convert_to_elastic, #read_option!
Methods included from Arities::Binary
Methods included from Arities::Polyadic
Methods included from Arities::Unary
Constructor Details
#initialize(sorts) ⇒ Sort
Returns a new instance of Sort.
5 6 7 |
# File 'lib/arelastic/searches/sort.rb', line 5 def initialize sorts @sorts = sorts end |
Instance Attribute Details
#sorts ⇒ Object (readonly)
Returns the value of attribute sorts.
4 5 6 |
# File 'lib/arelastic/searches/sort.rb', line 4 def sorts @sorts end |
Instance Method Details
#as_elastic ⇒ Object
9 10 11 |
# File 'lib/arelastic/searches/sort.rb', line 9 def as_elastic {'sort' => sorts.map { |sort| convert_to_elastic(sort) }} end |