def attribute(key, options = {})
      if primary_key = options.delete(:primary)
        @primary_key = key.to_sym
      end

      @attributes[key] = options.delete(:default)

      # All remaining options are assumed to be validations
      options.each do |validation, options|
        if options
          @validators << Validator.find(validation).new(key, options)
        end
      end

      key
    end
def attribute(key, options = {})
      if primary_key = options.delete(:primary)
        @primary_key = key.to_sym
      end

      @attributes[key] = options.delete(:default)

      # All remaining options are assumed to be validations
      options.each do |validation, options|
        if options
          @validators << Validator.find(validation).new(key, options)
        end
      end

      key
    end
DSL method for defining an attribute.

 @param [Symbol] key
   the key to use
 @param [Hash] options
   a list of options to create the attribute with

 @return [Symbol]
   the attribute