Class: DInstaller::DBus::UsersService
- Inherits:
-
Object
- Object
- DInstaller::DBus::UsersService
- Defined in:
- lib/dinstaller/dbus/users_service.rb
Overview
D-Bus service (org.opensuse.DInstaller.Users)
It connects to the system D-Bus and answers requests on objects below ‘/org/opensuse/DInstaller/Users1`.
Instance Attribute Summary collapse
-
#bus ⇒ ::DBus::Connection
readonly
System D-Bus.
Instance Method Summary collapse
-
#dispatch ⇒ Object
Call this from some main loop to dispatch the D-Bus messages.
-
#export ⇒ Object
Exports the installer object through the D-Bus service.
-
#initialize(_config, logger = nil) ⇒ UsersService
constructor
A new instance of UsersService.
Constructor Details
#initialize(_config, logger = nil) ⇒ UsersService
Returns a new instance of UsersService.
46 47 48 49 |
# File 'lib/dinstaller/dbus/users_service.rb', line 46 def initialize(_config, logger = nil) @logger = logger || Logger.new($stdout) @bus = ::DBus::SystemBus.instance end |
Instance Attribute Details
#bus ⇒ ::DBus::Connection (readonly)
System D-Bus
42 43 44 |
# File 'lib/dinstaller/dbus/users_service.rb', line 42 def bus @bus end |
Instance Method Details
#dispatch ⇒ Object
Call this from some main loop to dispatch the D-Bus messages
60 61 62 |
# File 'lib/dinstaller/dbus/users_service.rb', line 60 def dispatch bus. end |
#export ⇒ Object
Exports the installer object through the D-Bus service
52 53 54 55 56 57 |
# File 'lib/dinstaller/dbus/users_service.rb', line 52 def export dbus_objects.each { |o| service.export(o) } paths = dbus_objects.map(&:path).join(", ") logger.info "Exported #{paths} objects" end |