From 7e401c5310e3b5bdf26eb2b6b16be5be3b47c947 Mon Sep 17 00:00:00 2001 From: Martin Vidner Date: Tue, 16 Aug 2022 10:30:46 +0200 Subject: [PATCH] Declare the Introspectable interface, fixes #99 --- NEWS.md | 5 +++++ lib/dbus/object.rb | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/NEWS.md b/NEWS.md index aabce80..ac56499 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,11 @@ ## Unreleased +Bug fixes: + * Declare the Introspectable interface in exported objects([#99][]). + +[#99]: https://github.com/mvidner/ruby-dbus/issues/99 + ## Ruby D-Bus 0.18.1 - 2022-07-13 No changes since 0.18.0.beta8. diff --git a/lib/dbus/object.rb b/lib/dbus/object.rb index 7bdc974..65ae60c 100644 --- a/lib/dbus/object.rb +++ b/lib/dbus/object.rb @@ -459,5 +459,12 @@ def dbus_lookup_property(interface_name, property_name) dbus_signal :PropertiesChanged, "interface:s, changed_properties:a{sv}, invalidated_properties:as" end + + dbus_interface "org.freedesktop.DBus.Introspectable" do + dbus_method :Introspect, "out xml_data:s" do + # The body is not used, Connection#process handles it instead + # which is more efficient and handles paths without objects. + end + end end end