Module: Memoizer::InstanceMethods

Defined in:
lib/memoizer.rb

Instance Method Summary collapse

Instance Method Details

#unmemoize(method_name) ⇒ Object



59
60
61
# File 'lib/memoizer.rb', line 59

def unmemoize(method_name)
  self.instance_variable_set("@#{Memoizer.ivar_name(method_name)}", nil)
end

#unmemoize_allObject



63
64
65
66
67
68
69
# File 'lib/memoizer.rb', line 63

def unmemoize_all
  (methods + private_methods + protected_methods).each do |method|
    if method.to_s =~ /^_unmemoized_(.*)/
      unmemoize($1)
    end
  end
end