Module: DBus::Systemd::Mixin::MethodMissing
- Included in:
- Hostnamed, Importd::Manager, Importd::Transfer, Job, Localed, Logind::Manager, Logind::Seat, Logind::Session, Logind::User, DBus::Systemd::Machined::Image, DBus::Systemd::Machined::Machine, DBus::Systemd::Machined::Manager, DBus::Systemd::Manager, Networkd::Link, Networkd::Manager, Resolved::Link, Resolved::Manager, Timedated, Unit
- Defined in:
- lib/dbus/systemd/mixin.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
private
DBus::ProxyObject.
Instance Method Summary collapse
-
#method_missing(name, *args, &blk) ⇒ Object
use method_missing to proxy methods to the dbus proxy object interface methods.
-
#respond_to_missing?(*args) ⇒ Boolean
fix respond_to to also check the dbus methods.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &blk) ⇒ Object
use method_missing to proxy methods to the dbus proxy object interface methods
33 34 35 36 37 38 39 |
# File 'lib/dbus/systemd/mixin.rb', line 33 def method_missing(name, *args, &blk) if @object.respond_to?(name) @object.send(name, *args, &blk) else super end end |
Instance Attribute Details
#object ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns DBus::ProxyObject.
27 28 29 |
# File 'lib/dbus/systemd/mixin.rb', line 27 def object @object end |
Instance Method Details
#respond_to_missing?(*args) ⇒ Boolean
fix respond_to to also check the dbus methods
44 45 46 |
# File 'lib/dbus/systemd/mixin.rb', line 44 def respond_to_missing?(*args) @object.respond_to?(*args) || super end |