Method: Mongo::Model::BooleanType#cast

Defined in:
lib/mongo/model/support/conversions.rb

#cast(value) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/mongo/model/support/conversions.rb', line 28

def cast value
  if value.is_a? Boolean
    value
  else
    Mapping[value] || false
  end
end