From 5cfe9e5b6dd08d90d025e627c9859f12c3ef6c69 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 18 Mar 2023 11:38:32 +0000 Subject: [PATCH] Add comparison operator for IP addresses --- cookbooks/networking/libraries/ipaddresses.rb | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.39.5