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 @options = options end
Public Instance Methods
<=>(other)
click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 19 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 62 def disable raise NotImplementedError end
enable()
click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 58 def enable raise NotImplementedError end
exist?()
click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 42 def exist? raise NotImplementedError end
inspect()
click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 28 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 32 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 66 def running? raise NotImplementedError end
socket()
click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 13 def socket if @options[:socket] self.class.new("#{@options[:socket]}.socket", priority) end end
start()
click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 50 def start raise NotImplementedError end
status()
click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 46 def status raise NotImplementedError end
stop()
click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 54 def stop raise NotImplementedError end
to_s()
click to toggle source
# File lib/foreman_maintain/utils/service/abstract.rb, line 24 def to_s @name end