Sha256: 96f705ba2dc14da4cf9f9945f3dffe41df3cecb408a17780a9f1d67329bad7f8
Contents?: true
Size: 584 Bytes
Versions: 3
Compression:
Stored size: 584 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Criterion #:nodoc: # Complex criterion are used when performing operations on symbols to get # get a shorthand syntax for where clauses. # # Example: # # <tt>{ :field => { "$lt" => "value" } }</tt> # becomes: # <tt> { :field.lt => "value }</tt> class Complex attr_accessor :key, :operator def initialize(opts = {}) @key, @operator = opts[:key], opts[:operator] end def to_mongo_query v {"$#{operator}" => v} end end end end
Version data entries
3 entries across 3 versions & 1 rubygems