Skip to content

Commit

Permalink
Alias eql? and ==
Browse files Browse the repository at this point in the history
~~~
IPAddress.parse('::1') == IPAddress.parse('::1')   #=> true
IPAddress.parse('::1').eql? IPAddress.parse('::1') #=> true
~~~
  • Loading branch information
smortex committed Mar 19, 2016
1 parent c983123 commit 9b8d8fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/ipaddress/ipv4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ def <=>(oth)
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
Expand Down
1 change: 1 addition & 0 deletions lib/ipaddress/ipv6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ def <=>(oth)
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,
Expand Down

0 comments on commit 9b8d8fd

Please sign in to comment.