R
Rolando Abarca
--Apple-Mail-14-1040847564
Content-Type: multipart/alternative; boundary=Apple-Mail-13-1040847532
--Apple-Mail-13-1040847532
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed
This is how i'm currently getting a class object from a name:
cname = "A::B::C:"
klass = cname.split("::").inject(Kernel) {|a,b| a.const_get(b)}
I think it's pretty elegant, but I'm always happy to hear other ways
to do it ;-)
Anyone does this in some other way? (I don't want to eval code...)
regards,
--
Rolando Abarca
Phone: +56-9 97851962
--Apple-Mail-13-1040847532
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=ISO-8859-1
<HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space; ">This is how i'm currently =
getting a class object from a name:<DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>=A0 =A0 =A0=A0 =A0cname =3D =
"A::B::C:"</DIV><DIV>=A0 =A0 =A0 =A0 klass =3D =
cname.split("::").inject(Kernel) {|a,b| a.const_get(b)}</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>I think it's pretty =
elegant, but I'm always happy to hear other ways to do it =
;-)</DIV><DIV>Anyone does this in some other way? (I don't want to eval =
code...)</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>regards,<BR><DIV> <SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; =
"><DIV>--=A0</DIV><DIV>Rolando Abarca</DIV><DIV>Phone: +56-9 =
97851962</DIV><BR class=3D"Apple-interchange-newline"></SPAN> =
</DIV><BR></DIV></BODY></HTML>=
--Apple-Mail-13-1040847532--
--Apple-Mail-14-1040847564
content-type: application/pgp-signature; x-mac-type=70674453;
name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
iD8DBQFGyilJ9fOunnYODS4RAlCRAJ9+rHn8mKVgVJnoDKmPdj+8Lqt3pgCdEzC8
Wbn/cE7kM/vdADtf9+Wwd60=
=/+qj
-----END PGP SIGNATURE-----
--Apple-Mail-14-1040847564--
Content-Type: multipart/alternative; boundary=Apple-Mail-13-1040847532
--Apple-Mail-13-1040847532
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed
This is how i'm currently getting a class object from a name:
cname = "A::B::C:"
klass = cname.split("::").inject(Kernel) {|a,b| a.const_get(b)}
I think it's pretty elegant, but I'm always happy to hear other ways
to do it ;-)
Anyone does this in some other way? (I don't want to eval code...)
regards,
--
Rolando Abarca
Phone: +56-9 97851962
--Apple-Mail-13-1040847532
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=ISO-8859-1
<HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space; ">This is how i'm currently =
getting a class object from a name:<DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>=A0 =A0 =A0=A0 =A0cname =3D =
"A::B::C:"</DIV><DIV>=A0 =A0 =A0 =A0 klass =3D =
cname.split("::").inject(Kernel) {|a,b| a.const_get(b)}</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>I think it's pretty =
elegant, but I'm always happy to hear other ways to do it =
;-)</DIV><DIV>Anyone does this in some other way? (I don't want to eval =
code...)</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>regards,<BR><DIV> <SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; =
"><DIV>--=A0</DIV><DIV>Rolando Abarca</DIV><DIV>Phone: +56-9 =
97851962</DIV><BR class=3D"Apple-interchange-newline"></SPAN> =
</DIV><BR></DIV></BODY></HTML>=
--Apple-Mail-13-1040847532--
--Apple-Mail-14-1040847564
content-type: application/pgp-signature; x-mac-type=70674453;
name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
iD8DBQFGyilJ9fOunnYODS4RAlCRAJ9+rHn8mKVgVJnoDKmPdj+8Lqt3pgCdEzC8
Wbn/cE7kM/vdADtf9+Wwd60=
=/+qj
-----END PGP SIGNATURE-----
--Apple-Mail-14-1040847564--