Class: LinuxAdmin::Service

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/linux_admin/service.rb

Direct Known Subclasses

SysVInitService, SystemdService

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Logging

#logger

Constructor Details

#initialize(name) ⇒ Service

Returns a new instance of Service.



25
26
27
# File 'lib/linux_admin/service.rb', line 25

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject Also known as: id

Returns the value of attribute name.



23
24
25
# File 'lib/linux_admin/service.rb', line 23

def name
  @name
end

Class Method Details

.new(*args) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/linux_admin/service.rb', line 15

def self.new(*args)
  if self == LinuxAdmin::Service
    service_type.new(*args)
  else
    orig_new(*args)
  end
end

.service_type(reload = false) ⇒ Object



5
6
7
8
# File 'lib/linux_admin/service.rb', line 5

def self.service_type(reload = false)
  return @service_type if @service_type && !reload
  @service_type = service_type_uncached
end