def type *val
      return @chars_allowed if val.empty?

      dtype = val[0]
      #return self if @chars_allowed # disallow changing
      if dtype.is_a? Regexp 
        @chars_allowed = dtype
        return self
      end
      dtype = dtype.to_s.downcase.to_sym if dtype.is_a? String
      case dtype # missing to_sym would have always failed due to to_s 2011-09-30 1.3.1
      when :integer, Integer
        @chars_allowed = /\d/
      when :numeric, :float, Numeric, Float
        @chars_allowed = /[\d\.]/ 
      when :alpha
        @chars_allowed = /[a-zA-Z]/ 
      when :alnum
        @chars_allowed = /[a-zA-Z0-9]/ 
      else
        raise ArgumentError, "Field type: invalid datatype specified. Use :integer, :numeric, :float, :alpha, :alnum "
      end
      self
    end
def type *val
      return @chars_allowed if val.empty?

      dtype = val[0]
      #return self if @chars_allowed # disallow changing
      if dtype.is_a? Regexp 
        @chars_allowed = dtype
        return self
      end
      dtype = dtype.to_s.downcase.to_sym if dtype.is_a? String
      case dtype # missing to_sym would have always failed due to to_s 2011-09-30 1.3.1
      when :integer, Integer
        @chars_allowed = /\d/
      when :numeric, :float, Numeric, Float
        @chars_allowed = /[\d\.]/ 
      when :alpha
        @chars_allowed = /[a-zA-Z]/ 
      when :alnum
        @chars_allowed = /[a-zA-Z0-9]/ 
      else
        raise ArgumentError, "Field type: invalid datatype specified. Use :integer, :numeric, :float, :alpha, :alnum "
      end
      self
    end
NOTE: earlier there was some confusion over type, chars_allowed and datatype
 Now type and chars_allowed are merged into one.
 If you pass a symbol such as :integer, :float or Float Integer then some
  standard chars_allowed will be used. Otherwise you may pass a regexp.

 @param symbol :integer, :float, :alpha, :alnum, Float, Integer, Numeric, Regexp