Class: Array

Inherits:
Object show all
Defined in:
lib/mongo_mapper/support.rb

Class Method Summary collapse

Class Method Details

.from_mongo(value) ⇒ Object



13
14
15
# File 'lib/mongo_mapper/support.rb', line 13

def self.from_mongo(value)
  value || []
end

.to_mongo(value) ⇒ Object



8
9
10
11
# File 'lib/mongo_mapper/support.rb', line 8

def self.to_mongo(value)
  value = value.respond_to?(:lines) ? value.lines : value
  value.to_a
end