diff options
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index 97e20bdaf4..4abeb74c45 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -557,6 +557,7 @@ module ActiveSupport #:nodoc: def get Reference.get @name end + deprecate :get end def new(name) @@ -565,6 +566,11 @@ module ActiveSupport #:nodoc: end deprecate :new + def store(name) + self[name] = name + self + end + def clear! @store.clear end @@ -575,7 +581,14 @@ module ActiveSupport #:nodoc: def ref(name) Reference.new(name) end + deprecate :ref + + # Store a reference to a class +klass+. + def reference(klass) + Reference.store klass + end + # Get the reference for class named +name+. def constantize(name) Reference.get(name) end |