Class: Ipv6Network
- Inherits:
-
BasicNetworkType
- Object
- BasicNetworkType
- Ipv6Network
- Defined in:
- lib/ifconfig/common/network_types.rb
Instance Attribute Summary collapse
-
#addr ⇒ Object
readonly
Returns the value of attribute addr.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Attributes inherited from BasicNetworkType
Instance Method Summary collapse
-
#initialize(addr, scope = nil) ⇒ Ipv6Network
constructor
A new instance of Ipv6Network.
- #to_s ⇒ Object
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
#addr ⇒ Object (readonly)
Returns the value of attribute addr.
44 45 46 |
# File 'lib/ifconfig/common/network_types.rb', line 44 def addr @addr end |
#scope ⇒ Object (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_s ⇒ Object
46 47 48 |
# File 'lib/ifconfig/common/network_types.rb', line 46 def to_s " #{@nettype} Address: #{@addr}" end |