Class: DInstaller::DBus::BaseObject

Inherits:
DBus::Object
  • Object
show all
Defined in:
lib/dinstaller/dbus/base_object.rb

Overview

Base class for DBus objects

Instance Method Summary collapse

Constructor Details

#initialize(path, logger: nil) ⇒ BaseObject

Constructor



32
33
34
35
# File 'lib/dinstaller/dbus/base_object.rb', line 32

def initialize(path, logger: nil)
  @logger = logger || Logger.new($stdout)
  super(path)
end

Instance Method Details

#interfaces_and_propertiesHash

Generates information about interfaces and properties of the object

Returns a hash containing interfaces names as keys. Each value is the same hash that would be returned by the org.freedesktop.DBus.Properties.GetAll() method for that combination of object path and interface. If an interface has no properties, the empty hash is returned.



44
45
46
47
48
49
50
# File 'lib/dinstaller/dbus/base_object.rb', line 44

def interfaces_and_properties
  get_all_method = self.class.make_method_name("org.freedesktop.DBus.Properties", :GetAll)

  intfs.keys.each_with_object({}) do |interface, hash|
    hash[interface] = public_send(get_all_method, interface).first
  end
end