Class/Module Index [+]

Quicksearch

ActiveSupport::Memoizable::InstanceMethods

Public Instance Methods

flush_cache(*syms) click to toggle source
# File lib/active_support/memoizable.rb, line 47
def flush_cache(*syms)
  syms.each do |sym|
    (methods + private_methods + protected_methods).each do |m|
      if m.to_s =~ /^_unmemoized_(#{sym.to_s.gsub(/\?\Z/, '\?')})/
        ivar = ActiveSupport::Memoizable.memoized_ivar_for($1)
        instance_variable_get(ivar).clear if instance_variable_defined?(ivar)
      end
    end
  end
end
freeze_with_memoizable() click to toggle source
# File lib/active_support/memoizable.rb, line 19
def freeze_with_memoizable
  memoize_all unless frozen?
  freeze_without_memoizable
end
memoize_all() click to toggle source
# File lib/active_support/memoizable.rb, line 24
def memoize_all
  prime_cache ".*"
end
prime_cache(*syms) click to toggle source
# File lib/active_support/memoizable.rb, line 32
def prime_cache(*syms)
  syms.each do |sym|
    methods.each do |m|
      if m.to_s =~ /^_unmemoized_(#{sym})/
        if method(m).arity == 0
          __send__($1)
        else
          ivar = ActiveSupport::Memoizable.memoized_ivar_for($1)
          instance_variable_set(ivar, {})
        end
      end
    end
  end
end
unmemoize_all() click to toggle source
# File lib/active_support/memoizable.rb, line 28
def unmemoize_all
  flush_cache ".*"
end

Public Class Methods

included(base) click to toggle source
# File lib/active_support/memoizable.rb, line 11
def self.included(base)
  base.class_eval do
    unless base.method_defined?(:freeze_without_memoizable)
      alias_method_chain :freeze, :memoizable
    end
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.