From: Tom Hughes Date: Sat, 18 Mar 2023 11:38:32 +0000 (+0000) Subject: Add comparison operator for IP addresses X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/5cfe9e5b6dd08d90d025e627c9859f12c3ef6c69 Add comparison operator for IP addresses --- diff --git a/cookbooks/networking/libraries/ipaddresses.rb b/cookbooks/networking/libraries/ipaddresses.rb index 8efba26de..89b20fe9e 100644 --- a/cookbooks/networking/libraries/ipaddresses.rb +++ b/cookbooks/networking/libraries/ipaddresses.rb @@ -17,6 +17,10 @@ module OpenStreetMap @netmask = ip.netmask end + def <=>(other) + address <=> other.address + end + def to_s address end