Class: Google::Ads::GoogleAds::Interceptors::LoggingInterceptor::CycleFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/google/ads/google_ads/interceptors/logging_interceptor.rb

Instance Method Summary collapse

Constructor Details

#initializeCycleFinder

Returns a new instance of CycleFinder.



369
370
371
# File 'lib/google/ads/google_ads/interceptors/logging_interceptor.rb', line 369

def initialize
  @objects_seen = Set.new
end

Instance Method Details

#add_object(object) ⇒ Object



377
378
379
# File 'lib/google/ads/google_ads/interceptors/logging_interceptor.rb', line 377

def add_object(object)
  @objects_seen.add(object.object_id)
end

#is_cycle?(object) ⇒ Boolean

Returns:

  • (Boolean)


373
374
375
# File 'lib/google/ads/google_ads/interceptors/logging_interceptor.rb', line 373

def is_cycle?(object)
  @objects_seen.include?(object.object_id)
end