diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ipaddress/ipv6.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ipaddress/ipv6.rb b/lib/ipaddress/ipv6.rb index 33d4d19..88098bc 100644 --- a/lib/ipaddress/ipv6.rb +++ b/lib/ipaddress/ipv6.rb @@ -252,6 +252,15 @@ module IPAddress; end alias_method :group, :[] + # + # Updated the octet specified at index + # + def []=(index, value) + @groups[index] = value + initialize("#{IN6FORMAT % @groups}/#{prefix}") + end + alias_method :group=, :[]= + # # Returns a Base16 number representing the IPv6 # address |