Project

General

Profile

Bug #10113 ยป memoization_issue.rb

ronald05arias (Ron Arias), 08/06/2014 10:08 AM

 
module Klass
def self.memoizable_method_failing
@h ||= {}
@h['key with spaces'] ||= heavy_calculations()
return @h['key with spaces']
end

def self.memoizable_method_working
@h ||= {}
@h['key_without_spaces'] ||= heavy_calculations()
return @h['key_without_spaces']
end
end
    (1-1/1)