Sha256: f568d08fff05f7997731119104fb68560ce1e74fc36627ba68fbbe0adf70719c
Contents?: true
Size: 916 Bytes
Versions: 17
Compression:
Stored size: 916 Bytes
Contents
module Ddr::Index class Filter class << self delegate :where, :raw, :before_days, :before, :present, :absent, to: :new end attr_accessor :clauses def initialize @clauses = [ ] end def where(conditions) clauses = conditions.map do |field, value| if value.respond_to?(:each) QueryClause.or_values(field, *value) else QueryClause.term(field, value) end end raw *clauses end # Adds clause (String) w/o escaping def raw(*clauses) self.clauses += clauses self end def present(field) raw QueryClause.present(field) end def absent(field) raw QueryClause.absent(field) end def before(field, date_time) raw QueryClause.before(field, date_time) end def before_days(field, days) raw QueryClause.before_days(field, days) end end end
Version data entries
17 entries across 17 versions & 1 rubygems