class Elasticband::Filter::Term

Attributes

field[RW]
filter[RW]
options[RW]

Public Class Methods

new(filter, field, options = {}) click to toggle source
# File lib/elasticband/filter/term.rb, line 6
def initialize(filter, field, options = {})
  self.filter = filter
  self.field = field.to_sym
  self.options = options
end

Public Instance Methods

to_h() click to toggle source
# File lib/elasticband/filter/term.rb, line 12
def to_h
  { term: filter_hash }
end

Private Instance Methods

filter_hash() click to toggle source
# File lib/elasticband/filter/term.rb, line 18
def filter_hash
  { field => filter }.merge!(options)
end