Class: Qt::DBusInterface
Instance Method Summary collapse
Methods inherited from Base
#%, #&, #*, #**, #+, #-, #-@, #/, #<, #<<, #<=, #==, #>, #>=, #>>, #^, #methods, #protected_methods, #public_methods, q_classinfo, q_signal, q_slot, signals, #singleton_methods, slots, #|, #~
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(id, *args) ⇒ Object
474 475 476 477 478 479 480 481 482 483 484 485 486 |
# File 'lib/qt/qtruby4.rb', line 474 def method_missing(id, *args) begin # First look for a method in the Smoke runtime # If not found, then throw an exception and try dbus. super(id, *args) rescue if args.length == 0 return call(id.to_s).value else return call(id.to_s, *args).value end end end |
Instance Method Details
#call(method_name, *args) ⇒ Object
463 464 465 466 467 468 469 470 471 472 |
# File 'lib/qt/qtruby4.rb', line 463 def call(method_name, *args) if args.length == 0 return super(method_name) else # If the method is Qt::DBusInterface.call(), create an Array # 'dbusArgs' of Qt::Variants from '*args' qdbusArgs = args.collect {|arg| qVariantFromValue(arg)} return super(method_name, *qdbusArgs) end end |