Class: Currentable::Cleaner

Inherits:
Object
  • Object
show all
Defined in:
lib/currentable/cleaner.rb

Overview

Note:

Will only clean for objects stored on the calling thread.

Cleans up all registered current objects.

Examples:

Currentable::Cleaner.clean_all

Class Method Summary collapse

Class Method Details

.clean_allObject

Note:

Will only clean for objects stored on the calling thread.

Sets all registered Instance classes current value to nil



15
16
17
18
19
# File 'lib/currentable/cleaner.rb', line 15

def clean_all
  Currentable::Registry.currents.each do |klass|
    klass.current = nil
  end
end