Class: Ipv6Network

Inherits:
BasicNetworkType show all
Defined in:
lib/ifconfig/common/network_types.rb

Instance Attribute Summary collapse

Attributes inherited from BasicNetworkType

#nettype

Instance Method Summary collapse

Constructor Details

#initialize(addr, scope = nil) ⇒ Ipv6Network

Returns a new instance of Ipv6Network.



38
39
40
41
42
43
# File 'lib/ifconfig/common/network_types.rb', line 38

def initialize(addr,scope=nil)
  super()
  @nettype = 'inet6'
  @addr = IPAddr.new(addr)
  @scope = scope
end

Instance Attribute Details

#addrObject (readonly)

Returns the value of attribute addr.



44
45
46
# File 'lib/ifconfig/common/network_types.rb', line 44

def addr
  @addr
end

#scopeObject (readonly)

Returns the value of attribute scope.



44
45
46
# File 'lib/ifconfig/common/network_types.rb', line 44

def scope
  @scope
end

Instance Method Details

#to_sObject



46
47
48
# File 'lib/ifconfig/common/network_types.rb', line 46

def to_s
  " #{@nettype} Address: #{@addr}"
end