From: Henry House Date: 2001-09-06T05:10:41+09:00 Subject: [ruby-talk:20942] Re: calling original method in overrided method ? --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 06, 2001 at 04:57:08AM +0900, Barnett, Aaron wrote: >=20 > i think it'd go something like: >=20 > Class String > alias :to_i_orig :to_i >=20 > def to_i > fail "#{self} is not a valid integer" unless self =3D~ /^\d*$/ > to_i_orig > end > end Works like a charm! Thanks. --=20 Henry House OpenPGP key available from http://romana.hajhouse.org/hajhouse.asc --a8Wt8u1KmwUX3Y2C Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7lobCKK1cAVjXujwRApVWAJ4kN6t7hF2FPj4pIX5Gmnskx2NLMACcCvGN 4wKuSkuScl8p+BqmSf0VsdU= =WQMk -----END PGP SIGNATURE----- --a8Wt8u1KmwUX3Y2C--