Sha256: 9ec792f6b4732986857cf8d078e2874c7e28b83b6631f21fc9b9d2731e158b13

Contents?: true

Size: 398 Bytes

Versions: 9

Compression:

Stored size: 398 Bytes

Contents

class SymbolOperator
  def to_mongo_operator
    MongoModel::MongoOperator.new(field, operator)
  end
  
  def to_mongo_order_clause
    MongoModel::MongoOrder::Clause.new(field, operator.to_s == 'asc' ? :ascending : :descending)
  end
  
  def eql?(other)
    self == other
  end
  
  def hash
    field.hash ^ operator.hash
  end
end

class NilClass
  def to_mongo(value=nil)
    value
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mongomodel-0.5.5 lib/mongomodel/compatibility/mongo_mapper.rb
mongomodel-0.5.4 lib/mongomodel/compatibility/mongo_mapper.rb
mongomodel-0.5.3 lib/mongomodel/compatibility/mongo_mapper.rb
mongomodel-0.5.2 lib/mongomodel/compatibility/mongo_mapper.rb
mongomodel-0.5.1 lib/mongomodel/compatibility/mongo_mapper.rb
mongomodel-0.5.0 lib/mongomodel/compatibility/mongo_mapper.rb
mongomodel-0.4.9 lib/mongomodel/compatibility/mongo_mapper.rb
mongomodel-0.4.8 lib/mongomodel/compatibility/mongo_mapper.rb
mongomodel-0.4.7 lib/mongomodel/compatibility/mongo_mapper.rb