Module: DBus::Systemd::Helpers
- Defined in:
- lib/dbus/systemd/helpers.rb
Class Method Summary collapse
-
.map_array(array, map) ⇒ Hash
map an array to a hash from an index map.
-
.session_bus ⇒ DBus::SessionBus
get an instance of the session bus.
-
.system_bus ⇒ DBus::SystemBus
get an instance of the system bus.
Class Method Details
.map_array(array, map) ⇒ Hash
map an array to a hash from an index map
48 49 50 51 52 53 54 55 56 |
# File 'lib/dbus/systemd/helpers.rb', line 48 def map_array(array, map) mapped = {} array.each_with_index do |item, index| mapped[map.key(index)] = item end mapped end |
.session_bus ⇒ DBus::SessionBus
get an instance of the session bus
38 39 40 |
# File 'lib/dbus/systemd/helpers.rb', line 38 def session_bus DBus::SessionBus.instance end |
.system_bus ⇒ DBus::SystemBus
get an instance of the system bus
30 31 32 |
# File 'lib/dbus/systemd/helpers.rb', line 30 def system_bus DBus::SystemBus.instance end |