Class: Construqt::Services::DhcpV4Relay
- Inherits:
-
Object
- Object
- Construqt::Services::DhcpV4Relay
- Defined in:
- lib/construqt/services.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#servers ⇒ Object
Returns the value of attribute servers.
Instance Method Summary collapse
- #add_server(ip) ⇒ Object
-
#initialize(name) ⇒ DhcpV4Relay
constructor
A new instance of DhcpV4Relay.
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
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/construqt/services.rb', line 5 def name @name end |
#servers ⇒ Object
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 |