class Daedal::Filters::RangeFilter
Public Class Methods
new(options={})
click to toggle source
Calls superclass method
# File lib/daedal/filters/range_filter.rb, line 15 def initialize(options={}) super options unless !gte.nil? or !gt.nil? or !lt.nil? or !lte.nil? raise "Must give at least one of gte, gt, lt, or lte" end end
Public Instance Methods
to_hash()
click to toggle source
# File lib/daedal/filters/range_filter.rb, line 22 def to_hash {range: {field => {gte: gte, lte: lte, lt: lt, gt: gt}.select {|k,v| !v.nil?}}} end