Module: DBusInterface::Object
- Included in:
- NetworkManager::DBus::ActiveConnection, NetworkManager::DBus::Device, NetworkManager::DBus::Dhcp4Config, NetworkManager::DBus::EthernetDevice, NetworkManager::DBus::Ip4Config, NetworkManager::DBus::Root, NetworkManager::DBus::Settings, NetworkManager::DBus::SettingsConnection
- Defined in:
- lib/dbus_interface/object.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#[](key) ⇒ Object
shortcut to access properties.
- #call(method, *args) ⇒ Object
- #initialize(object_path = nil) ⇒ Object
- #object_path ⇒ Object
- #object_path=(p) ⇒ Object
- #properties ⇒ Object
- #to_s ⇒ Object
Class Method Details
.included(some_base) ⇒ Object
2 3 4 |
# File 'lib/dbus_interface/object.rb', line 2 def self.included(some_base) some_base.extend(DBusInterface::Class) end |
Instance Method Details
#[](key) ⇒ Object
shortcut to access properties
35 36 37 |
# File 'lib/dbus_interface/object.rb', line 35 def [](key) properties[key] end |
#call(method, *args) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/dbus_interface/object.rb', line 6 def call(method, *args) if object_path == nil || object_path == '/' nil else DBusInterface::Connection.call(self.class.default_iface, object_path, method, *args) end end |
#initialize(object_path = nil) ⇒ Object
22 23 24 |
# File 'lib/dbus_interface/object.rb', line 22 def initialize(object_path = nil) self.object_path = object_path if object_path end |
#object_path ⇒ Object
30 31 32 |
# File 'lib/dbus_interface/object.rb', line 30 def object_path @object_path || self.class.object_path end |
#object_path=(p) ⇒ Object
26 27 28 |
# File 'lib/dbus_interface/object.rb', line 26 def object_path=(p) @object_path = p end |
#properties ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/dbus_interface/object.rb', line 14 def properties if self.class.no_properties? nil else call('all_properties') end end |
#to_s ⇒ Object
39 40 41 |
# File 'lib/dbus_interface/object.rb', line 39 def to_s "#{self.class} #{properties}" end |