--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 = Hash.new()
public
def set(key, val)
@test_hash[key] = val
end
end
asdf = Testing.new
asdf.set("foo", "bar")
########### End 1st block of code ###############
########### Begin 2nd block of code ###############
class Testing
def initialize
@test_hash = Hash.new()
end
public
def set(key, val)
@test_hash[key] = val
end
end
asdf = 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]
--
Sean Chittenden
--gAUgrzRZ7tRi/Yr6
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Comment: Sean Chittenden <sean / chittenden.org>
iEYEARECAAYFAjtL+ngACgkQn09c7x7d+q24xQCg0NulZv6mUd8IfjC55cQMtvTV
PUUAn0MmIt5pZaTEkIM+gPnDo1XuXLZy
Lr
-----END PGP SIGNATURE-----
--gAUgrzRZ7tRi/Yr6--