Class: DBus::Service

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

Overview

Base class for exporting your own Services across the Bus

Just inherit from Service, providing the name of your service (e.g. org.designfu.SampleService)

Instance Method Summary collapse

Constructor Details

#initialize(name, bus = nil) ⇒ Service

Returns a new instance of Service.


191
192
193
194
195
196
# File 'lib/dbus.rb', line 191

def initialize(name, bus=nil)
  @name = name
  @bus = bus
  @bus = Bus.new if @bus.nil?
  DBus::Binding::bus_acquire_service(@bus.get_connection, @name)
end

Instance Method Details

#get_busObject

The bus this service is defined on


204
205
206
# File 'lib/dbus.rb', line 204

def get_bus
  @bus
end

#get_nameObject

The name of this service


199
200
201
# File 'lib/dbus.rb', line 199

def get_name
  @name
end