Class: Arelastic::Aggregations::Filter

Inherits:
Aggregation show all
Defined in:
lib/arelastic/aggregations/filter.rb

Instance Attribute Summary collapse

Attributes inherited from Aggregation

#name, #options

Instance Method Summary collapse

Methods inherited from Aggregation

#as_elastic, #nested

Methods inherited from Nodes::Node

#==, #convert_to_elastic

Methods included from Arelastic::Arities::Binary

#binary

Methods included from Arelastic::Arities::Polyadic

#polyadic

Methods included from Arelastic::Arities::Unary

#unary

Constructor Details

#initialize(name, filter) ⇒ Filter

Returns a new instance of Filter.



6
7
8
9
# File 'lib/arelastic/aggregations/filter.rb', line 6

def initialize name, filter
  super name
  @filter = filter
end

Instance Attribute Details

#filterObject

Returns the value of attribute filter.



4
5
6
# File 'lib/arelastic/aggregations/filter.rb', line 4

def filter
  @filter
end

Instance Method Details

#as_elastic_aggregationObject



11
12
13
# File 'lib/arelastic/aggregations/filter.rb', line 11

def as_elastic_aggregation
  {'filter' => convert_to_elastic(filter)}
end