From: Eric Hodel Date: 2002-11-05T06:00:26+09:00 Subject: Re: strange behavior of quit/exit --CC5qiHV/f0UkyWC4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable gminick (gminick@underground.org.pl) wrote: > Just take a look: > I want to take a look at methods for quit or exit with irb: >=20 > % irb > Reading config file... done. > ruby-1.7.3 on i586-pc-linux with irb 0.9(02/07/03) > Type 'info' for more information. Feel free to use help(anObject) ;] > >>> quit.methods > Time spent with irb: 00:00:08. > % _ >=20 > For me it looks like an unwanted behavior.=20 >=20 > % cat >rb.rb < a =3D exit.methods > a.each { |x| puts x } > EOF > % ruby rb.rb > % _ >=20 > It prints nothing.=20 > Either, exit and quit, aren't objects for me anymore ;) exit and quit aren't objects, they're methods. What you're doing is invoking them. You probably want: irb(main):003:0> Object.method(:exit).methods ["to_s", "unbind", "[]", "to_proc", "clone", "inspect", "arity", "call", "=3D=3D", "public_methods", "taint", "equal?", "=3D=3D=3D", "method= ", "kind_of?", "display", "instance_eval", "to_a", "type", "private_methods", "freeze", "id", "extend", "=3D~", "eql?", "singleton_methods", "tainted?", "is_a?", "methods", "dup", "nil?", "class", "instance_of?", "instance_variables", "send", "frozen?", "__id__", "__send__", "untaint", "respond_to?", "hash", "protected_methods"] irb(main):004:0> --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --CC5qiHV/f0UkyWC4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQE9xt/nMypVHHlsnwQRApAuAJ9cpj/EvSPYkKZuM58SvrORzovDbACg3/Im lKl0k8iGeviEG2yoTZYs1ZY= =CmKI -----END PGP SIGNATURE----- --CC5qiHV/f0UkyWC4--