Class: MongoModel::Types::Object

Inherits:
Object
  • Object
show all
Defined in:
lib/mongomodel/support/types/object.rb

Instance Method Summary collapse

Instance Method Details

#boolean(value) ⇒ Object


8
9
10
# File 'lib/mongomodel/support/types/object.rb', line 8

def boolean(value)
  !value.blank?
end

#cast(value) ⇒ Object


4
5
6
# File 'lib/mongomodel/support/types/object.rb', line 4

def cast(value)
  value
end

#from_mongo(value) ⇒ Object


16
17
18
# File 'lib/mongomodel/support/types/object.rb', line 16

def from_mongo(value)
  value
end

#to_mongo(value) ⇒ Object


12
13
14
# File 'lib/mongomodel/support/types/object.rb', line 12

def to_mongo(value)
  value
end

#to_query(value) ⇒ Object


20
21
22
# File 'lib/mongomodel/support/types/object.rb', line 20

def to_query(value)
  to_mongo(cast(value))
end