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