Class: RBus::Bus
- Inherits:
-
Proxy
- Object
- BlankSlate
- Proxy
- RBus::Bus
- Defined in:
- lib/rbus/bus/bus.rb
Overview
Represents a connection to a Bus. It is also a Proxy object for sending messages to the bus itself.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#message_loop ⇒ Object
readonly
Returns the value of attribute message_loop.
-
#names ⇒ Object
readonly
Returns the value of attribute names.
-
#transport ⇒ Object
readonly
Returns the value of attribute transport.
Instance Method Summary collapse
-
#get_object(well_known_name, object_path) ⇒ Object
Returns a remote object for well-known name and object path.
-
#initialize(server_address) ⇒ Bus
constructor
Connect to Bus with
server_address
, which can contain multiple addresses to try, separated by semicolons.
Methods inherited from Proxy
#Introspect, #connect!, #interface!, #method!, #method_missing, #parse_arguments!, parse_introspect
Constructor Details
#initialize(server_address) ⇒ Bus
Connect to Bus with server_address
, which can contain multiple addresses to try, separated by semicolons.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/rbus/bus/bus.rb', line 54 def initialize(server_address) raise InvalidAddressException, 'Empty address' if server_address.empty? # Can be several addresses, separated by ; server_address.split(';').each do |address| @transport = Transport.connect(address) end # Not used for anything, save at all? @guid = Auth.(@transport) # Setup mainloop. @message_loop = Mainloop.new(self) @well_known_name = 'org.freedesktop.DBus' @object_path = '/org/freedesktop/DBus' @interface = 'org.freedesktop.DBus' @names = [ Hello() ] Introspect() Log.debug('Bus names:', @names) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RBus::Proxy
Instance Attribute Details
#message_loop ⇒ Object (readonly)
Returns the value of attribute message_loop.
50 51 52 |
# File 'lib/rbus/bus/bus.rb', line 50 def @message_loop end |
#names ⇒ Object (readonly)
Returns the value of attribute names.
50 51 52 |
# File 'lib/rbus/bus/bus.rb', line 50 def names @names end |
#transport ⇒ Object (readonly)
Returns the value of attribute transport.
50 51 52 |
# File 'lib/rbus/bus/bus.rb', line 50 def transport @transport end |