Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo_odm/core_ext/conversions.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) type_cast(value)



57
58
59
60
# File 'lib/mongo_odm/core_ext/conversions.rb', line 57

def self.type_cast(value)
  return nil if value.nil?
  value.to_a.map {|elem| MongoODM.instanciate(elem)}
end

Instance Method Details

- (Object) dereference



66
67
68
# File 'lib/mongo_odm/core_ext/conversions.rb', line 66

def dereference
  MongoODM.instanciate(self.map{|value| MongoODM.dereference(value)})
end

- (Object) to_mongo



62
63
64
# File 'lib/mongo_odm/core_ext/conversions.rb', line 62

def to_mongo
  self.map {|elem| elem.to_mongo}
end