class Mongomatic::TypeConverters::Base

Public Class Methods

new(orig_val) click to toggle source
# File lib/mongomatic/type_converters.rb, line 10
def initialize(orig_val)
  @orig_val = orig_val
end

Public Instance Methods

cast() click to toggle source
# File lib/mongomatic/type_converters.rb, line 18
def cast
  if type_match?
    @orig_val
  else
    convert_orig_val || raise(CannotCastValue)
  end
end
convert_orig_val() click to toggle source
# File lib/mongomatic/type_converters.rb, line 26
def convert_orig_val
  raise "abstract"
end
type_match?() click to toggle source
# File lib/mongomatic/type_converters.rb, line 14
def type_match?
  raise "abstract"
end