From: Eric Hodel Date: 2003-03-29T11:28:28+09:00 Subject: Re: [ANN] tld.rb 0.11 - Check wether a given TLD is valid or not --EVcIhgQsEzAXu06J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Josef 'Jupp' Schugt (jupp@gmx.de) wrote: > tld.rb allows you to check wether a TLD (top level domain) is valid > or not where 'to be valid' means that the TLD is presently in use on > the Internet.=20 irb(main):001:0> require 'tld' =3D> true irb(main):002:0> TLD.valid? 'org' NameError: undefined method `valid?' for TLD:Module from (irb):2 irb(main):003:0> TLD::valid? 'org' NameError: undefined method `valid?' for TLD:Module from (irb):3 irb(main):004:0> include TLD =3D> Object irb(main):005:0> valid? 'org' =3D> true If you use def self.valid? and friends, it'll work without having to use include. Also, method names in Ruby are typically all_lowercase_with_underscore and, as a personal nit-pick, I dislike is_foo? methods, I prefer either is_foo or foo? --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --EVcIhgQsEzAXu06J Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+hQTKMypVHHlsnwQRAg4IAKCDoNHr9X1iEGsha+LzcDDQEdnwcACfXdcs ey+fcxAuSks2htgPHj5/pX8= =VmxT -----END PGP SIGNATURE----- --EVcIhgQsEzAXu06J--