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: object_parser.rb
    path of file: ./repos/mushroom-observer/app/classes/api2/parsers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class API2
  module Pars
    
      def find_object(type, id, str)
        val = nil
        limit.each do |model|
          next unless model.type_tag.to_s.casecmp(type).zero?

          val = model.safe_find(id)
          return val if val

          raise(ObjectNotFoundById.new(str, model))
        end
        raise(BadLimitedParameterValue.new(str, limit.map(&:type_tag)))
      end