From: Dave Thomas Date: 2001-03-06T14:59:14+09:00 Subject: [ruby-talk:12093] Another hook If we're in to hooks, there's another that might be useful: to_bool: analogous to to_s, called whenever an object is used in a context that requires a boolean value (this one came up on #ruby-lang). Masochists could use this to emulate Perl class Numeric def to_bool self != 0 end end class String def to_bool self != "0" end end This could get rolled in to the new Boolean class (or whatever it will be called). (So, let's see whose idea I've stolen this time :) Dave