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.



171
172
173
174
175
176
# File 'lib/dbus.rb', line 171

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



184
185
186
# File 'lib/dbus.rb', line 184

def get_bus
  @bus
end

#get_nameObject

The name of this service



179
180
181
# File 'lib/dbus.rb', line 179

def get_name
  @name
end