summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRomain Tartière <romain@blogreen.org>2016-03-19 11:31:57 +0100
committerRomain Tartière <romain@blogreen.org>2016-03-19 11:31:57 +0100
commit9b8d8fdd6489472349843d4607f8be8e05024857 (patch)
tree20dc2a942dd5305ad208dcc1b98cd125222a1c42
parentc9831237b01eb672e1f59cf607a9a57bbcd61476 (diff)
downloadipaddress-9b8d8fdd6489472349843d4607f8be8e05024857.tar.gz
Alias eql? and ==
~~~ IPAddress.parse('::1') == IPAddress.parse('::1') #=> true IPAddress.parse('::1').eql? IPAddress.parse('::1') #=> true ~~~
-rw-r--r--lib/ipaddress/ipv4.rb1
-rw-r--r--lib/ipaddress/ipv6.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/ipaddress/ipv4.rb b/lib/ipaddress/ipv4.rb
index 7d8e0d3..3ad2c15 100644
--- a/lib/ipaddress/ipv4.rb
+++ b/lib/ipaddress/ipv4.rb
@@ -512,6 +512,7 @@ module IPAddress;
return prefix <=> oth.prefix if to_u32 == oth.to_u32
to_u32 <=> oth.to_u32
end
+ alias eql? ==
#
# Returns the number of IP addresses included
diff --git a/lib/ipaddress/ipv6.rb b/lib/ipaddress/ipv6.rb
index 88098bc..2dda4d2 100644
--- a/lib/ipaddress/ipv6.rb
+++ b/lib/ipaddress/ipv6.rb
@@ -490,6 +490,7 @@ module IPAddress;
return prefix <=> oth.prefix if to_u128 == oth.to_u128
to_u128 <=> oth.to_u128
end
+ alias eql? ==
#
# Returns the address portion of an IP in binary format,