Project

General

Profile

Actions

Bug #10113

closed

Ruby memoization behaving oddly when using hash keys with spaces

Added by ronald05arias (Ron Arias) over 9 years ago. Updated over 9 years ago.

Status:
Rejected
Assignee:
Target version:
-
ruby -v:
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]
[ruby-core:64227]

Description

Trying to use simple Hash memoization with a ruby hash in a class method, it "fails" when having spaces as the hash key. Example code is attached.
When calling the memoization method, it fails to maintain the instance variable. It resets the variable every time the method is called.
When not having spaces in the key of the Hash, it works as it should, memoizing the variable.

P.S. Despite my ruby version indicated bellow, it fails in the newest as well.


Files

memoization_issue.rb (305 Bytes) memoization_issue.rb ronald05arias (Ron Arias), 08/06/2014 10:08 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0