Class: Construqt::Services
- Inherits:
-
Object
- Object
- Construqt::Services
- Defined in:
- lib/construqt/services.rb
Defined Under Namespace
Classes: DhcpV4Relay, DhcpV6Relay, Radvd
Instance Method Summary collapse
- #add(service) ⇒ Object
- #find(name) ⇒ Object
-
#initialize ⇒ Services
constructor
A new instance of Services.
Constructor Details
#initialize ⇒ Services
Returns a new instance of Services.
37 38 39 |
# File 'lib/construqt/services.rb', line 37 def initialize @services = {} end |
Instance Method Details
#add(service) ⇒ Object
47 48 49 50 |
# File 'lib/construqt/services.rb', line 47 def add(service) @services[service.name] = service self end |
#find(name) ⇒ Object
41 42 43 44 45 |
# File 'lib/construqt/services.rb', line 41 def find(name) found = @services[name] throw "service with name #{name} not found" unless found found end |