Module: MongoModel::Types

Defined in:
lib/mongomodel/support/types.rb,
lib/mongomodel/support/types/set.rb,
lib/mongomodel/support/types/date.rb,
lib/mongomodel/support/types/hash.rb,
lib/mongomodel/support/types/time.rb,
lib/mongomodel/support/types/array.rb,
lib/mongomodel/support/types/float.rb,
lib/mongomodel/support/types/custom.rb,
lib/mongomodel/support/types/object.rb,
lib/mongomodel/support/types/string.rb,
lib/mongomodel/support/types/symbol.rb,
lib/mongomodel/support/types/boolean.rb,
lib/mongomodel/support/types/integer.rb,
lib/mongomodel/support/types/rational.rb,
lib/mongomodel/support/types/date_time.rb,
lib/mongomodel/support/types/openstruct.rb

Defined Under Namespace

Classes: Array, Boolean, Custom, Date, DateTime, Float, Hash, Integer, Object, OpenStruct, Rational, Set, String, Symbol, Time

Constant Summary collapse

CONVERTERS =
Hash.new { |h, k| h[k] = Types::Custom.new(k) }

Class Method Summary collapse

Class Method Details

.converter_for(type) ⇒ Object


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

def self.converter_for(type)
  CONVERTERS[type]
end

.register_converter(type, converter) ⇒ Object


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

def self.register_converter(type, converter)
  CONVERTERS[type] = converter
end