Class: QML::Dispatchable::Proxy
- Inherits:
- BasicObject
- Defined in:
- lib/qml/dispatchable.rb
Instance Method Summary collapse
-
#initialize(obj) ⇒ Proxy
constructor
A new instance of Proxy.
-
#method_missing(name, *args, &block) ⇒ Object
Actually enqueues the method call using QML.later.
Constructor Details
#initialize(obj) ⇒ Proxy
9 10 11 |
# File 'lib/qml/dispatchable.rb', line 9 def initialize(obj) @obj = obj end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
Actually enqueues the method call using QML.later.
14 15 16 17 18 |
# File 'lib/qml/dispatchable.rb', line 14 def method_missing(name, *args, &block) ::QML.later do @obj.__send__(name, *args, &block) end end |