Class DBus::Object
In: lib/dbus.rb
Parent: DBusCallable

Base class for exporting your own Objects across the Bus

Just inherit from Object and provide a list of the symbol names for methods to share across the bus. These will appear as member functions of your Service object.

Methods

emit_signal   new  

Public Class methods

[Source]

     # File lib/dbus.rb, line 273
273:     def initialize(object_path, service, dbus_methods=[])
274:       @connection = service.get_bus.get_connection
275:       super(@connection, dbus_methods)
276:       @object_path = object_path
277:       @service = service
278:       @connection.register_object_path(@object_path, method(:on_unregister), method(:on_message))
279:     end

Public Instance methods

Emit the signal signal_name for interface interface, and include args in the signal message.

[Source]

     # File lib/dbus.rb, line 283
283:     def emit_signal(interface, signal_name, *args)
284:       message = DBus::Binding::DBusMessage.new_signal(@object_path, interface, signal_name)
285:       iter = message.get_iter
286:       args.each{|a| iter.append(a)}
287:       @connection.send(message)
288:     end

[Validate]