Parent

Class/Module Index [+]

Quicksearch

ActiveSupport::Dependencies::ClassCache

Public Instance Methods

[](key) click to toggle source
# File lib/active_support/dependencies.rb, line 547
def [](key)
  key = key.name if key.respond_to?(:name)

  @store[key]
end
Also aliased as: get
[]=(key, value) click to toggle source
# File lib/active_support/dependencies.rb, line 539
def []=(key, value)
  return unless key.respond_to?(:name)

  raise(ArgumentError, 'anonymous classes cannot be cached') if key.name.blank?

  @store[key.name] = value
end
clear!() click to toggle source
# File lib/active_support/dependencies.rb, line 576
def clear!
  @store.clear
end
empty?() click to toggle source
# File lib/active_support/dependencies.rb, line 531
def empty?
  @store.empty?
end
get(key) click to toggle source
Alias for: []
key?(key) click to toggle source
# File lib/active_support/dependencies.rb, line 535
def key?(key)
  @store.key?(key)
end
new(name) click to toggle source
# File lib/active_support/dependencies.rb, line 565
def new(name)
  self[name] = name
  Getter.new(name)
end
store(name) click to toggle source
# File lib/active_support/dependencies.rb, line 571
def store(name)
  self[name] = name
  self
end

Public Class Methods

new() click to toggle source
# File lib/active_support/dependencies.rb, line 527
def initialize
  @store = Hash.new { |h, k| h[k] = Inflector.constantize(k) }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.