Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion No Keys, nor other hash methods on multidimensional hash

View parsed - Show only message text

Path: g2news1.google.com!news2.google.com!proxad.net!newsfeed.stueberl.de!news.osn.de!diablo1-ffm.news.osn.de!noris.net!not-for-mail
From: Xeno Campanoli <x...@eskimo.com>
Newsgroups: comp.lang.ruby
Subject: No Keys, nor other hash methods on multidimensional hash
Date: Tue, 23 Aug 2005 04:14:16 +0900
Lines: 17
Message-ID: <200508221913.MAA03156@eskimo.com>
NNTP-Posting-Host: sinus.lauschmusik.de
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: ork-un.noris.net 1124738085 13755 213.95.32.201 (22 Aug 2005 19:14:45 GMT)
X-Complaints-To: news@noris.net
NNTP-Posting-Date: Mon, 22 Aug 2005 19:14:45 +0000 (UTC)
X-received-from: This message has been automatically forwarded from
   the ruby-talk mailing list by a gateway at lauschmusik.de. If it is
   SPAM, it did not originate at lauschmusik.de. Please report the 
   original sender, and not us. Thanks!
   Please see http://hypermetrics.com/rubyhacker/clrFAQ.html#tag24 to.
X-ML-Name: ruby-talk
X-Mail-Count: 153264
X-ruby-talk: <200508221913.MAA03...@eskimo.com>
X-rubymirror: yes

Okay, I'm taking the example I got last week for multi-dimensional hashes, and
I don't have access to any Hash methods:

pHash = lambda { Hash.new {|h,k| h[k] = pHash.call }
pHash['1']['a'] = "one"
p pHash.keys

I run this and get the result:

..undefined method `keys' for ... (NoMethodError)

Do I need to dereference or something, or is this just something that doesn't
work after all?

Sincerely, Xeno Campanoli, Ruby neophyte and general paraphernalian.



Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google