Class: Google::Ads::GoogleAds::Interceptors::LoggingInterceptor::CycleFinder
- Inherits:
-
Object
- Object
- Google::Ads::GoogleAds::Interceptors::LoggingInterceptor::CycleFinder
- Defined in:
- lib/google/ads/google_ads/interceptors/logging_interceptor.rb
Instance Method Summary collapse
- #add_object(object) ⇒ Object
-
#initialize ⇒ CycleFinder
constructor
A new instance of CycleFinder.
- #is_cycle?(object) ⇒ Boolean
Constructor Details
#initialize ⇒ CycleFinder
Returns a new instance of CycleFinder.
362 363 364 |
# File 'lib/google/ads/google_ads/interceptors/logging_interceptor.rb', line 362 def initialize @objects_seen = Set.new end |
Instance Method Details
#add_object(object) ⇒ Object
370 371 372 |
# File 'lib/google/ads/google_ads/interceptors/logging_interceptor.rb', line 370 def add_object(object) @objects_seen.add(object.object_id) end |
#is_cycle?(object) ⇒ Boolean
366 367 368 |
# File 'lib/google/ads/google_ads/interceptors/logging_interceptor.rb', line 366 def is_cycle?(object) @objects_seen.include?(object.object_id) end |