# File lib/active_support/dependencies.rb, line 520 def initialize @store = ThreadSafe::Cache.new end
# File lib/active_support/dependencies.rb, line 550 def clear! @store.clear end
# File lib/active_support/dependencies.rb, line 524 def empty? @store.empty? end
# File lib/active_support/dependencies.rb, line 532 def get(key) key = key.name if key.respond_to?(:name) @store[key] ||= Inflector.constantize(key) end
# File lib/active_support/dependencies.rb, line 528 def key?(key) @store.key?(key) end
# File lib/active_support/dependencies.rb, line 538 def safe_get(key) key = key.name if key.respond_to?(:name) @store[key] ||= Inflector.safe_constantize(key) end
# File lib/active_support/dependencies.rb, line 543 def store(klass) return self unless klass.respond_to?(:name) raise(ArgumentError, 'anonymous classes cannot be cached') if klass.name.empty? @store[klass.name] = klass self end