class Mongomatic::TypeConverters::Bool

Public Instance Methods

convert_orig_val() click to toggle source
# File lib/mongomatic/type_converters.rb, line 89
def convert_orig_val
  s_val = @orig_val.to_s.downcase
  if %w(1 t true y yes).include?(s_val)
    true
  elsif %w(0 f false n no).include?(s_val)
    false
  else
    nil
  end
end
type_match?() click to toggle source
# File lib/mongomatic/type_converters.rb, line 85
def type_match?
  @orig_val == true || @orig_val == false
end