Class: Elasticband::Query::Filtered

Inherits:
Elasticband::Query show all
Defined in:
lib/elasticband/query/filtered.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Elasticband::Query

parse

Constructor Details

#initialize(filter, query = nil, options = {}) ⇒ Filtered

Returns a new instance of Filtered.



6
7
8
9
10
# File 'lib/elasticband/query/filtered.rb', line 6

def initialize(filter, query = nil, options = {})
  self.filter = filter
  self.query = query
  self.options = options
end

Instance Attribute Details

#filterObject

Returns the value of attribute filter.



4
5
6
# File 'lib/elasticband/query/filtered.rb', line 4

def filter
  @filter
end

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/elasticband/query/filtered.rb', line 4

def options
  @options
end

#queryObject

Returns the value of attribute query.



4
5
6
# File 'lib/elasticband/query/filtered.rb', line 4

def query
  @query
end

Instance Method Details

#to_hObject



12
13
14
# File 'lib/elasticband/query/filtered.rb', line 12

def to_h
  { filtered: query_hash }
end