class Elasticband::Filter::Query

Attributes

options[RW]
query[RW]

Public Class Methods

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

Public Instance Methods

to_h() click to toggle source
# File lib/elasticband/filter/query.rb, line 11
def to_h
  return query_hash if options.blank?

  { fquery: query_hash.merge!(options) }
end

Private Instance Methods

query_hash() click to toggle source
# File lib/elasticband/filter/query.rb, line 19
def query_hash
  { query: query.to_h }
end