From: Jos Backus Date: 2006-12-02T06:14:08+09:00 Subject: Re: cidr.rb: port of Perl's Net::CIDR v0.11 available On Sat, Dec 02, 2006 at 06:03:59AM +0900, Daniel Berger wrote: > Hm, I'll have to think about the API. I suppose the most simple > approach is to just add accessors for duration and ip_address (with a > 'nil' value by default). In practice, then, your code would look like this: > > if p.ping? > puts p.ip_address > puts p.duration > end > > How does that look? I like this much better than the positional API that Perl uses here ("Is duration the 1st or 2nd return value?"). Plus it makes it easy to add futher items down the road without breaking existing code. +1. -- Jos Backus jos at catnook.com