class Api::Filters::Between

Public Instance Methods

build_param() click to toggle source
# File lib/api/filters/between.rb, line 8
def build_param
  { @field => extract_param }
end
elastic_query() click to toggle source
# File lib/api/filters/between.rb, line 12
def elastic_query
  param = @condition.match(/\((.*),(.*)\)/)
  { range: { :"#{@field}" => { gte: "#{param[1]}", lte: "#{param[2]}" } } }
end
extract_param() click to toggle source
# File lib/api/filters/between.rb, line 17
def extract_param
  query_param = @condition.match(/\((.*),(.*)\)/)
  query_param[1]..query_param[2]
end