Class: Array

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

Class Method Summary collapse

Class Method Details

.from_mongo(value) ⇒ Object



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

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

.to_mongo(value) ⇒ Object



3
4
5
6
# File 'lib/mongo_mapper/extensions.rb', line 3

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