Class: Elasticband::Filter::Exists

Inherits:
Elasticband::Filter show all
Defined in:
lib/elasticband/filter/exists.rb

Constant Summary

Constants inherited from Elasticband::Filter

PARSE_FILTERS

Instance Attribute Summary collapse

Attributes inherited from Elasticband::Filter

#options

Instance Method Summary collapse

Methods inherited from Elasticband::Filter

parse, #parse

Constructor Details

#initialize(field) ⇒ Exists

Returns a new instance of Exists.



6
7
8
# File 'lib/elasticband/filter/exists.rb', line 6

def initialize(field)
  self.field = field.to_sym
end

Instance Attribute Details

#fieldObject

Returns the value of attribute field.



4
5
6
# File 'lib/elasticband/filter/exists.rb', line 4

def field
  @field
end

Instance Method Details

#to_hObject



10
11
12
# File 'lib/elasticband/filter/exists.rb', line 10

def to_h
  { exists: { field: field } }
end