Skip to content
Snippets Groups Projects
Commit 548f0071 authored by Michael Miller's avatar Michael Miller Committed by Romain Tartière
Browse files

Implement unique_local? method

parent 5a089bda
No related branches found
No related tags found
No related merge requests found
......@@ -436,6 +436,20 @@ module IPAddress;
[self.class.new("fe80::/64")].any? {|i| i.include? self}
end
#
# Checks if an IPv6 address objects belongs
# to a unique-local network RFC4193
#
# Example:
#
# ip = IPAddress "fc00::1"
# ip.unique_local?
# #=> true
#
def unique_local?
[self.class.new("fc00::/7")].any? {|i| i.include? self}
end
#
# Returns true if the address is a mapped address
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment