On Jun 7, 2010, at 4:26 PM, Aaron D. Gifford wrote:

> Without having looked at your library, does it support IP ranges (i.e.
> blocks of IP addresses that are contiguous but do not necessarily
> exactly match a subnet boundary)?   Perhaps as a separate class?
> 
> Can one do this?
> 
> ip = IPAddress.new("10.0.0.1") ## No prefix specified... will it
> assume /32 IPv4 host prefix?
> 
> Also, are there methods to determine if a network (or range, if
> supported) contains another IP, network, or range?  Something like:
> 
> ip = IPAddress.new("10.0.0.1/32")
> net = IPAddress.new("10.0.0.0/24")
> puts "IP is contained by network" if net.contains?(ip) || ip.is_in?(net)

Taking two seconds to peruse the (very simple) source would have given you your answer.

http://github.com/bluemonk/ipaddress/blob/master/lib/ipaddress/ipv4.rb#L499

cr