Class: Construqt::Services::DhcpV6Relay
- Inherits:
-
Object
- Object
- Construqt::Services::DhcpV6Relay
- Defined in:
- lib/construqt/services.rb
Defined Under Namespace
Classes: Server
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(name) ⇒ Object
-
#initialize(name) ⇒ DhcpV6Relay
constructor
A new instance of DhcpV6Relay.
Constructor Details
#initialize(name) ⇒ DhcpV6Relay
Returns a new instance of DhcpV6Relay.
25 26 27 28 |
# File 'lib/construqt/services.rb', line 25 def initialize(name) self.name = name self.servers = [] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
24 25 26 |
# File 'lib/construqt/services.rb', line 24 def name @name end |
#servers ⇒ Object
Returns the value of attribute servers.
24 25 26 |
# File 'lib/construqt/services.rb', line 24 def servers @servers end |
#services ⇒ Object
Returns the value of attribute services.
24 25 26 |
# File 'lib/construqt/services.rb', line 24 def services @services end |
Instance Method Details
#add_server(name) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/construqt/services.rb', line 32 def add_server(name) (ip, iface) = name.split("%") throw "ip not set #{name}" unless ip ip = IPAddress.parse(ip) throw "ip must be a v6 address" unless ip.ipv6? throw "iface not set #{name}" if iface.nil? || iface.empty? server = Server.new server.ip = ip server.iface = iface self.servers << server self end |