Sha256: 0847f32ea78903c5c39ef901ed94b3b8c8812e23f38698e1183ff361501b00fc

Contents?: true

Size: 432 Bytes

Versions: 6

Compression:

Stored size: 432 Bytes

Contents

module Ddr
  module Managers
    class IndexManager < Manager

      def indexes
        @indexes ||= {}
      end

      def index(method, *args)
        @indexes = indexes.merge(method: ActiveFedora::SolrService.solr_name(method, *args))
      end

      def to_solr(solr_doc)
        indexes.each_with_object(solr_doc) do |(method, field), doc|
          doc[field] = object.send(method)
        end
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ddr-models-1.13.1 lib/ddr/managers/#index_manager.rb#
ddr-models-1.13.0 lib/ddr/managers/#index_manager.rb#
ddr-models-1.11.4 lib/ddr/managers/#index_manager.rb#
ddr-models-1.11.3 lib/ddr/managers/#index_manager.rb#
ddr-models-1.11.2 lib/ddr/managers/#index_manager.rb#
ddr-models-1.9.0 lib/ddr/managers/#index_manager.rb#