adham90/elastic_map

View on GitHub
lib/elastic_map/index/mapper.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module ElasticMap
  class Index
    # Map Elasticsearch results to ElasticMap::Index object
    #
    module Mapper
      # Maps _index_hash to ElasticMap::Fields
      #
      # @param args [ElasticMap::Field] the parsing field.
      # return [Type] the parsed data.
      def map_field(field)
        field.parse(_index_data[field.name])
      end
    end
  end
end