class ForemanMaintain::Utils::Service::Abstract

Attributes

name[R]
priority[R]

Public Class Methods

new(name, priority, _options = {}) click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 7
def initialize(name, priority, _options = {})
  @name = name
  @priority = priority
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 12
def <=>(other)
  prio_cmp = @priority <=> other.priority
  prio_cmp == 0 ? @name <=> other.name : prio_cmp
end
disable() click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 55
def disable
  raise NotImplementedError
end
enable() click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 51
def enable
  raise NotImplementedError
end
exist?() click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 35
def exist?
  raise NotImplementedError
end
inspect() click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 21
def inspect
  "#{self.class.name.split('::').last}(#{@name} [#{@priority}])"
end
matches?(service) click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 25
def matches?(service)
  if service.is_a? String
    service == @name
  elsif service.instance_of?(self.class)
    service.name == @name
  else
    false
  end
end
running?() click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 59
def running?
  raise NotImplementedError
end
start() click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 43
def start
  raise NotImplementedError
end
status() click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 39
def status
  raise NotImplementedError
end
stop() click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 47
def stop
  raise NotImplementedError
end
to_s() click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 17
def to_s
  @name
end