From: Alex Fenton Date: 2006-02-13T09:18:34+09:00 Subject: Re: Idiomatic ruby eastcoastcoder@gmail.com wrote: > Ruby does not allow subclassing true and false, so, if these methods > return one of those, they can't return any additional info. But > sometimes the caller needs additional info, as in: > > if !valid? logger.warn "Not valid: #{why not?}" Use exceptions, which can contain readable messages def my_meth validate # .. proceed rescue => err logger.warn "Not valid #{err}" end # if you want a boolean-style method def valid? validate && true # assuming validate returns some kind of true value rescue false end alex