def check_type(type)
      if type.respond_to?(:validate!)
        type.validate!(self)
      elsif klass = self.class.factory(type.to_s)
        klass.new.validate!(self)
      else
        raise "invalid type supplied for validation check"
      end
    end
def check_type(type)
      if type.respond_to?(:validate!)
        type.validate!(self)
      elsif klass = self.class.factory(type.to_s)
        klass.new.validate!(self)
      else
        raise "invalid type supplied for validation check"
      end
    end
Validate against a specific type.