Problema con dbus

Ciao, premetto che conosco ancora poco Ruby.

Sto provando l’interfacciamento con dbus (su una Debian ‘squeeze’).

Questo è il codice di esempio:
http://trac.luon.net/data/ruby-dbus/tutorial/basic_client.html

require ‘dbus’
bus = DBus::SessionBus.instance
rb_service = bus.service(“org.gnome.Rhythmbox”)
rb_player = rb_service.object(“/org/gnome/Rhythmbox/Player”)
rb_player_iface = rb_player[“org.gnome.Rhythmbox.Player”]
puts rb_player_iface.getPlayingUri

Il risultato è:
undefined method ‘getPlayingUri’ for nil:Class (NoMethodError)

E’ un bug o cosa ?

Grazie
Walter

Alessandro S. wrote:

Walter Valenti wrote:

rb_player_iface = rb_player[“org.gnome.Rhythmbox.Player”]
puts rb_player_iface.getPlayingUri

se fai puts rb_player.inspect cosa stampa?

Problema risolto.

require ‘dbus’
bus = DBus::SessionBus.instance
rb_service = bus.service(“org.gnome.Rhythmbox”)
rb_player = rb_service.object("/org/gnome/Rhythmbox/Player")
rb_player.introspect #### mancava questo !!!
rb_player_iface = rb_player[“org.gnome.Rhythmbox.Player”]
puts rb_player_iface.getPlayingUri

Walter Valenti wrote:

rb_player_iface = rb_player[“org.gnome.Rhythmbox.Player”]
puts rb_player_iface.getPlayingUri

se fai puts rb_player.inspect cosa stampa?