From: David Vallner Date: 2006-10-09T07:57:03+09:00 Subject: Re: How to use a class --------------enig6252592E9F6CD7950A8E887C Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Li Chen wrote: > Now I have other questions: 1) After I write a class with some methods = I=20 > want to save the file called test. Which extension is associated with=20 > this file(test.rb or else)? How do I create a new object from the file = > called test from another script? >=20 You save the file as test.rb, and then in the other file, use: require 'test' to be able to use classes in it. > 2)Which method is used globally for the following substitution ? > s1=3D"AATTCCGG" # original string > s2=3D"TTAAGGCC" # expected string, which means A->T, T->A, C->G, G-= >C >=20 irb(main):001:0> "AATTCCGG".tr("ATCG", "TAGC") =3D> "TTAAGGCC" David Vallner --------------enig6252592E9F6CD7950A8E887C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFKYI7y6MhrS8astoRAvorAJ0a/fDYVgSftTX2uZGThjORs5M99QCfZrXz MwJ60sJ1L6rmeG9B8BVI+TQ= =zwVm -----END PGP SIGNATURE----- --------------enig6252592E9F6CD7950A8E887C--