Class: Arelastic::Searches::Sort

Inherits:
Search show all
Defined in:
lib/arelastic/searches/sort.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Nodes::Node

#==, #convert_to_elastic, #read_option!

Methods included from Arities::Binary

#binary

Methods included from Arities::Polyadic

#polyadic

Methods included from Arities::Unary

#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

#sortsObject (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_elasticObject



9
10
11
# File 'lib/arelastic/searches/sort.rb', line 9

def as_elastic
  {'sort' => sorts.map { |sort| convert_to_elastic(sort) }}
end