You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: lazy_dig_method.rb
    path of file: ./repos/ams_lazy_relationships/lib/ams_lazy_relationships/core
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module AmsLazyRelationships::Core
  # Provides `lazy_dig` as an instance method for serializers, in order to make
  # possible to dig relationships in depth just like `Hash#dig` do, keeping the
  # laziness and N+1-free evaluation.
  module LazyDigMethod
    
    def lazy_dig(*relation_names)
      relationships = {
        multiple: false,
        data: [{
          serializer: self.class,
          object: object
        }]
      }

      relation_names.each do |relation_name|
        lazy_dig_relationship!(relation_name, relationships)
      end

      objects = relationships[:data].map { |r| r[:object] }

      relationships[:multiple] ? objects : objects.first
    end