Class: Systemd::Unit::ServiceUnit

Inherits:
Object
  • Object
show all
Defined in:
lib/systemd/unit/service_unit.rb

Overview

Object representation of a Systemd Service Unit object

Constant Summary collapse

@@indices =

Systemd mapping of properties to array index see www.freedesktop.org/wiki/Software/systemd/dbus/ rubocop:disable Style/ClassVars

{ name: 0, human_name: 1, load_state: 2,
active_state: 3, sub_state: 4, follower: 5, object_path: 6,
job_id: 7, job_type: 8, job_path: 9 }

Instance Method Summary collapse

Constructor Details

#initialize(unit_entry) ⇒ ServiceUnit

Returns a new instance of ServiceUnit.



15
16
17
# File 'lib/systemd/unit/service_unit.rb', line 15

def initialize(unit_entry)
  @@indices.each { |key, value| send("#{key}=", unit_entry[value]) }
end