def attribute(name, options={}, &block)
      raise ArgumentError.new("You cannot use #{name} as an attribute name since it is a reserved method name of Xapian::Document") if reserved_method_name?(name)
      do_not_index    = options.delete(:index) == false
      @type_map[name] = (options.delete(:as) || :string)

      if block_given?
        @attributes_hash[name] = {:block => block}.merge(options)
      else
        @attributes_hash[name] = options
      end
      self.index(name, options, &block) unless do_not_index
    end
def attribute(name, options={}, &block)
      raise ArgumentError.new("You cannot use #{name} as an attribute name since it is a reserved method name of Xapian::Document") if reserved_method_name?(name)
      do_not_index    = options.delete(:index) == false
      @type_map[name] = (options.delete(:as) || :string)

      if block_given?
        @attributes_hash[name] = {:block => block}.merge(options)
      else
        @attributes_hash[name] = options
      end
      self.index(name, options, &block) unless do_not_index
    end
Add an attribute to the blueprint. Attributes will be stored in the xapian documents an can be
 accessed from a search result.
 @param [String] name The name of the method that delivers the value for the attribute
 @param [Hash] options
 @option options [Integer] :weight (1) The weight for this attribute.
 @option options [Boolean] :index (true) Should the attribute be indexed?
 @option options [Symbol] :as should add type info for range queries (:date, :numeric)
 @example For complex attribute configurations you may pass a block:
   XapianDb::DocumentBlueprint.setup(:IndexedObject) do |blueprint|
     blueprint.attribute :complex do
       if @id == 1
         "One"
       else
         "Not one"
       end
     end
   end