Class: Construqt::Services::DhcpV6Relay

Inherits:
Object
  • Object
show all
Defined in:
lib/construqt/services.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ DhcpV6Relay

Returns a new instance of DhcpV6Relay.



19
20
21
22
# File 'lib/construqt/services.rb', line 19

def initialize(name)
  self.name = name
  self.servers = []
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



18
19
20
# File 'lib/construqt/services.rb', line 18

def name
  @name
end

#serversObject

Returns the value of attribute servers.



18
19
20
# File 'lib/construqt/services.rb', line 18

def servers
  @servers
end

Instance Method Details

#add_server(ip) ⇒ Object



23
24
25
26
27
28
# File 'lib/construqt/services.rb', line 23

def add_server(ip)
  ip = IPAddress.parse(ip)
  throw "ip must be a v6 address" unless ip.ipv6?
  self.servers << ip
  self
end