Parent

Class Index [+]

Quicksearch

ActiveSupport::Dependencies::ClassCache

Public Class Methods

new() click to toggle source
     # File lib/active_support/dependencies.rb, line 540
540:       def initialize
541:         @store = Hash.new
542:       end

Public Instance Methods

[](key) click to toggle source
Alias for: get
clear!() click to toggle source
     # File lib/active_support/dependencies.rb, line 573
573:       def clear!
574:         @store.clear
575:       end
empty?() click to toggle source
     # File lib/active_support/dependencies.rb, line 544
544:       def empty?
545:         @store.empty?
546:       end
get(key) click to toggle source
     # File lib/active_support/dependencies.rb, line 552
552:       def get(key)
553:         key = key.name if key.respond_to?(:name)
554:         @store[key] ||= Inflector.constantize(key)
555:       end
Also aliased as: []
key?(key) click to toggle source
     # File lib/active_support/dependencies.rb, line 548
548:       def key?(key)
549:         @store.key?(key)
550:       end
safe_get(key) click to toggle source
     # File lib/active_support/dependencies.rb, line 558
558:       def safe_get(key)
559:         key = key.name if key.respond_to?(:name)
560:         @store[key] || begin
561:           klass = Inflector.safe_constantize(key)
562:           @store[key] = klass
563:         end
564:       end
store(klass) click to toggle source
     # File lib/active_support/dependencies.rb, line 566
566:       def store(klass)
567:         return self unless klass.respond_to?(:name)
568:         raise(ArgumentError, 'anonymous classes cannot be cached') if klass.name.empty?
569:         @store[klass.name] = klass
570:         self
571:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.