Class: Iface::ValueSet::IpV4Primary

Inherits:
Pair
  • Object
show all
Defined in:
lib/iface/value_set/pair.rb

Overview

Represents a pair for IPADDR

Instance Attribute Summary

Attributes inherited from Pair

#name

Instance Method Summary collapse

Methods inherited from Pair

create, #raw_value, #to_s

Constructor Details

#initialize(_name, value, value_set) ⇒ IpV4Primary

Returns a new instance of IpV4Primary.



45
46
47
48
# File 'lib/iface/value_set/pair.rb', line 45

def initialize(_name, value, value_set)
  super('IPADDR', value, value_set)
  self.value = value
end

Instance Method Details

#valueObject



50
51
52
# File 'lib/iface/value_set/pair.rb', line 50

def value
  IpV4Address.from_numeric(@value).to_s
end

#value=(new_value) ⇒ Object



54
55
56
57
# File 'lib/iface/value_set/pair.rb', line 54

def value=(new_value)
  @value = IpV4Address.new(new_value).to_i
  self
end