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.
-
#services ⇒ Object
Returns the value of attribute services.
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.
12 13 14 15 |
# File 'lib/construqt/services.rb', line 12 def initialize(name) self.name = name self.servers = [] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/construqt/services.rb', line 11 def name @name end |
#servers ⇒ Object
Returns the value of attribute servers.
11 12 13 |
# File 'lib/construqt/services.rb', line 11 def servers @servers end |
#services ⇒ Object
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 |