diff options
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index d5c51ca417..97e20bdaf4 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -549,10 +549,21 @@ module ActiveSupport #:nodoc: end alias :get :[] + class Getter # :nodoc: + def initialize(name) + @name = name + end + + def get + Reference.get @name + end + end + def new(name) self[name] = name - self + Getter.new(name) end + deprecate :new def clear! @store.clear |