Class: Construqt::Services::DhcpV4Relay

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ DhcpV4Relay

Returns a new instance of DhcpV4Relay.



6
7
8
9
# File 'lib/construqt/services.rb', line 6

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

Instance Attribute Details

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/construqt/services.rb', line 5

def name
  @name
end

#serversObject

Returns the value of attribute servers.



5
6
7
# File 'lib/construqt/services.rb', line 5

def servers
  @servers
end

Instance Method Details

#add_server(ip) ⇒ Object



10
11
12
13
14
15
# File 'lib/construqt/services.rb', line 10

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