From: 7stud -- Date: 2012-12-29T07:51:19+09:00 Subject: Re: Ruby Koans regarding Hashes. 7stud -- wrote in post #1090511: > > ...ruby stores the block somewhere, and then every time you try to > access a non-existent key, ruby executes the block. > I don't know if you know it or not but ruby's built in methods can have strange names. For instance, when you write: hash[key] = something ...that is syntactic sugar for this method call: hash.[]=(key) And the method's name is "[]=". And when the argument to the method is a non-existent key, the []= method returns an array reference. -- Posted via http://www.ruby-forum.com/.