From: Quintus Date: 2013-05-10T15:52:09+09:00 Subject: Re: Hash name is not recognized by Ruby unless first letter is capitalized --Sig_/RNQoP2ZzW9_CdL1AatI=9aE Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Fri, 10 May 2013 15:10:08 +0900 schrieb Phil Lou : > Hi, all: >=20 > My little test code below will not recognize the hash variable > if its first letter is not capitalized. If the first letter is > capitalized, > then everything is OK. I'll appreciate any explanation for this > behavior. In Ruby, everything starting with a capital letter is a constant. Constants are visible globally anywhere in a program, hence you can access it in your method. The =E2=80=9Cdef=E2=80=9D keyword creates a new scope where you can=E2=80= =99t access veriables from the outside, which is why you can=E2=80=99t see them inside the method. Vale, Marvin --=20 Blog: http://pegasus-alpha.eu/blog ASCII-Ribbon-Kampagne () | ASCII Ribbon Campaign () - Stoppt HTML-E-Mail /\ | - Against HTML E-Mail /\ - Stoppt propriet=C3=A4re Anh=C3=A4nge | - Against proprietary attachm= ents www.asciiribbon.org/index-de.html | www.asciiribbon.org --Sig_/RNQoP2ZzW9_CdL1AatI=9aE Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQEcBAEBAgAGBQJRjJcKAAoJELh1XLHFkqhadngH/3DX0EebFLn3OFnSPX2ZNpBM lHQpzL0DxnOf0HwoCW7KK0ye/jmmQbFUf+MppdiP7jlocpGLXJieEN+JcKucp6nS ZaODrDRhM7/yxqbv1qnQni8ECPaR05Ol0GdUjTr2ZA33jgFGcurfbYTs1wPrks3w ycHrstltOrOqFB0LEXqnKQ+yswsjni+TT8quRsOq6EWrjzuewxDeLX3A6jhTEqSO yifoooqrf6AU8sZ3T+0Uit0yee0OSwOpTB3XobHYwIhWwcVmzxmZz3c9bCz53cKR C4Jer4uRsAs6tZc/Kl+0hFi9ZUar9jBU7ReMibh1mIlgKY+vcXMm+x8L1wYvDJg= =fDpX -----END PGP SIGNATURE----- --Sig_/RNQoP2ZzW9_CdL1AatI=9aE--