Class: DInstaller::DBus::Questions

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

Overview

This class represents a D-Bus object implementing ObjectManager interface for questions

Questions uses a QuestionsManager as backend and exports a Question object when a Question is added to the questions manager. A Question is unexported when a Question is deleted from the questions manager.

Callbacks of QuestionsManager are used to ensure that the proper D-Bus actions are performed when adding, deleting or waiting for answers.

Instance Method Summary collapse

Constructor Details

#initialize(backend, logger) ⇒ Questions

Constructor

The callbacks of the backend are configured to perform the proper D-Bus actions, see #register_callbacks.

Parameters:



50
51
52
53
54
55
56
57
58
# File 'lib/dinstaller/dbus/questions.rb', line 50

def initialize(backend, logger)
  @backend = backend
  @logger = logger
  @exported_questions = []

  register_callbacks

  super(PATH)
end

Instance Method Details

#managed_objectsHash

Information provided by ObjectManger for each exported object

Returns a hash containing paths of exported objects as keys. Each value is the information of interfaces and properties for that object, see BaseObject#interfaces_and_properties.

Returns:

  • (Hash)


66
67
68
# File 'lib/dinstaller/dbus/questions.rb', line 66

def managed_objects
  exported_questions.each_with_object({}) { |q, h| h[q.path] = q.interfaces_and_properties }
end