From: Sean Chittenden Date: 2001-07-11T16:04:34+09:00 Subject: [ruby-talk:17638] Hash as an instance variable... --gAUgrzRZ7tRi/Yr6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Howdy. I'm not 100% sure why the 1st chunk of code doesn't work. I know the second one does, but given my knowledge of other languages, this strikes me bug-ish, but not necessarily a bug (maybe in terms of lack of documentation). Thoughts? ########### Begin 1st block of code ############### class Testing @test_hash =3D Hash.new() public def set(key, val) @test_hash[key] =3D val end end asdf =3D Testing.new asdf.set("foo", "bar") ########### End 1st block of code ############### ########### Begin 2nd block of code ############### class Testing def initialize @test_hash =3D Hash.new() end public def set(key, val) @test_hash[key] =3D val end end asdf =3D Testing.new asdf.set("foo", "bar") ########### End 1st block of code ############### -sc PS In the event that this is a bug: ruby 1.6.4 (2001-06-19) [i386-freebsd4.3] --=20 Sean Chittenden --gAUgrzRZ7tRi/Yr6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Comment: Sean Chittenden iEYEARECAAYFAjtL+ngACgkQn09c7x7d+q24xQCg0NulZv6mUd8IfjC55cQMtvTV PUUAn0MmIt5pZaTEkIM+gPnDo1XuXLZy =I3Lr -----END PGP SIGNATURE----- --gAUgrzRZ7tRi/Yr6--