Module: RDBI::Type::Checks

Includes:
TypeLib::Canned::Checks
Defined in:
lib/rdbi/types.rb

Overview

Module for canned checks that are unique to RDBI. Includes the canned checks from TypeLib.

Constant Summary collapse

IS_NULL =
proc { |obj| obj.nil? }
IS_BIGDECIMAL =
proc { |obj| obj.kind_of?(BigDecimal) }
IS_DATETIME =
proc { |obj| obj.kind_of?(DateTime) }
IS_BOOLEAN =
proc { |obj| obj.kind_of?(TrueClass) or obj.kind_of?(FalseClass) }
STR_IS_BOOLEAN =
proc { |obj| obj.kind_of?(String) and obj =~ /^(t(rue)?|f(alse)?|1|0)$/i }