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.



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

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

Instance Attribute Details

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#serversObject

Returns the value of attribute servers.



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

def servers
  @servers
end

#servicesObject

Returns the value of attribute services.



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

def services
  @services
end

Instance Method Details

#add_server(ip) ⇒ Object



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

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