def accessors_module
      return @accessors_module unless @accessors_module.nil?
      @accessors_module = Module.new

      # Add the accessors for the indexed class and the score
      @accessors_module.instance_eval do

        define_method :indexed_class do
          self.values[0].value
        end

        define_method :score do
          @score
        end

        define_method :attributes do
          blueprint = XapianDb::DocumentBlueprint.blueprint_for indexed_class
          blueprint.attribute_names.inject({}) { |hash, attr| hash.tap { |hash| hash[attr.to_s] = self.send attr } }
        end
      end

      # Add an accessor for each attribute
      attribute_names.each do |attribute|
        index = DocumentBlueprint.value_number_for(attribute)
        codec = XapianDb::TypeCodec.codec_for @type_map[attribute]
        @accessors_module.instance_eval do
          define_method attribute do
            codec.decode self.value(index)
          end
        end
      end

      # Let the adapter add its document helper methods (if any)
      _adapter.add_doc_helper_methods_to(@accessors_module)
      @accessors_module
    end
def accessors_module
      return @accessors_module unless @accessors_module.nil?
      @accessors_module = Module.new

      # Add the accessors for the indexed class and the score
      @accessors_module.instance_eval do

        define_method :indexed_class do
          self.values[0].value
        end

        define_method :score do
          @score
        end

        define_method :attributes do
          blueprint = XapianDb::DocumentBlueprint.blueprint_for indexed_class
          blueprint.attribute_names.inject({}) { |hash, attr| hash.tap { |hash| hash[attr.to_s] = self.send attr } }
        end
      end

      # Add an accessor for each attribute
      attribute_names.each do |attribute|
        index = DocumentBlueprint.value_number_for(attribute)
        codec = XapianDb::TypeCodec.codec_for @type_map[attribute]
        @accessors_module.instance_eval do
          define_method attribute do
            codec.decode self.value(index)
          end
        end
      end

      # Let the adapter add its document helper methods (if any)
      _adapter.add_doc_helper_methods_to(@accessors_module)
      @accessors_module
    end
Lazily build and return a module that implements accessors for each field
 @return [Module] A module containing all accessor methods