]> git.openstreetmap.org Git - chef.git/commitdiff
Add comparison operator for IP addresses
authorTom Hughes <tom@compton.nu>
Sat, 18 Mar 2023 11:38:32 +0000 (11:38 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 18 Mar 2023 11:38:32 +0000 (11:38 +0000)
cookbooks/networking/libraries/ipaddresses.rb

index 8efba26de195624e0196e5d61ae9a193ea8f4330..89b20fe9e9d13a81bcb4c4eb2bfc4e85c0b5727a 100644 (file)
@@ -17,6 +17,10 @@ module OpenStreetMap
           @netmask = ip.netmask
         end
 
           @netmask = ip.netmask
         end
 
+        def <=>(other)
+          address <=> other.address
+        end
+
         def to_s
           address
         end
         def to_s
           address
         end