class MongoModel::MongoOperator
Attributes
field[R]
operator[R]
Public Class Methods
new(field, operator)
click to toggle source
# File lib/mongomodel/support/mongo_operator.rb, line 5 def initialize(field, operator) @field, @operator = field, operator end
Public Instance Methods
==(other)
click to toggle source
# File lib/mongomodel/support/mongo_operator.rb, line 17 def ==(other) other.is_a?(self.class) && field == other.field && operator == other.operator end
eql?(other)
click to toggle source
# File lib/mongomodel/support/mongo_operator.rb, line 25 def eql?(other) self == other end
hash()
click to toggle source
# File lib/mongomodel/support/mongo_operator.rb, line 21 def hash field.hash ^ operator.hash end
inspect()
click to toggle source
# File lib/mongomodel/support/mongo_operator.rb, line 13 def inspect "#{field.inspect}.#{operator}" end
to_mongo_selector(value)
click to toggle source
# File lib/mongomodel/support/mongo_operator.rb, line 9 def to_mongo_selector(value) { "$#{operator}" => value } end