From: Bertram Scharpf Date: 2009-06-19T23:44:34+09:00 Subject: Re: hash of hash? Hi, Am Freitag, 19. Jun 2009, 23:08:12 +0900 schrieb Jeroen Lodewijks: > class Hashhash > def initialize > @dt = { 2 => {2 => "H", 3 => "C"}, > 3 => {2 => "H", 9 => "Dh"}, > "T" => {2 => "C", 9 => "S"} > } > return @dt > end > end def [] key ; @dt[ key] ; end You don't need to return anything from `initialize' because its return value is discarded and the invoking `new' method always returns the created object. Btw you don't need to return anything rom assigment methods `member=' either. Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de