Class: DBus::Systemd::Job

Inherits:
Object
  • Object
show all
Includes:
Mixin::MethodMissing, Mixin::Properties
Defined in:
lib/dbus/systemd/job.rb

Constant Summary collapse

INTERFACE =

systemd job object dbus interface

'org.freedesktop.systemd1.Job'.freeze

Instance Attribute Summary

Attributes included from Mixin::MethodMissing

#object

Instance Method Summary collapse

Methods included from Mixin::Properties

#properties

Methods included from Mixin::MethodMissing

#method_missing, #respond_to_missing?

Constructor Details

#initialize(id, manager = Manager.new) ⇒ Job

Creates a job object for interfacing with a systemd job

Parameters:

  • id (Integer)

    the job id

  • manager (DBus::Systemd::Manager) (defaults to: Manager.new)

    the systemd manager to query



38
39
40
41
42
43
# File 'lib/dbus/systemd/job.rb', line 38

def initialize(id, manager = Manager.new)
  job_path = manager.GetJob(id).first
  @object = manager.service.object(job_path)
  @object.default_iface = INTERFACE
  @object.introspect
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class DBus::Systemd::Mixin::MethodMissing