Class: Construqt::Services

Inherits:
Object
  • Object
show all
Defined in:
lib/construqt/services.rb

Defined Under Namespace

Classes: ConntrackD, DhcpV4Relay, DhcpV6Relay, Radvd

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(region) ⇒ Services

Returns a new instance of Services.



54
55
56
57
# File 'lib/construqt/services.rb', line 54

def initialize(region)
  @region = region
  @services = {}
end

Instance Attribute Details

#regionObject (readonly)

Returns the value of attribute region.



53
54
55
# File 'lib/construqt/services.rb', line 53

def region
  @region
end

Instance Method Details

#add(service) ⇒ Object



65
66
67
68
69
# File 'lib/construqt/services.rb', line 65

def add(service)
  @services[service.name] = service
  service.services = self
  self
end

#find(name) ⇒ Object



59
60
61
62
63
# File 'lib/construqt/services.rb', line 59

def find(name)
  found = @services[name]
  throw "service with name #{name} not found" unless found
  found
end