Class: Jscall::RemoteRef
- Inherits:
-
Object
- Object
- Jscall::RemoteRef
- Defined in:
- lib/jscall.rb
Direct Known Subclasses
Instance Method Summary collapse
- #__get_id ⇒ Object
- #async ⇒ Object
- #async_send(name, *args) ⇒ Object
-
#initialize(id) ⇒ RemoteRef
constructor
A new instance of RemoteRef.
- #method_missing(name, *args) ⇒ Object
-
#send(name, *args) ⇒ Object
override Object#send.
-
#then(*args) ⇒ Object
override Object#then.
-
#to_ary ⇒ Object
puts() calls this.
Constructor Details
#initialize(id) ⇒ RemoteRef
Returns a new instance of RemoteRef.
90 91 92 |
# File 'lib/jscall.rb', line 90 def initialize(id) @id = id end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
121 122 123 |
# File 'lib/jscall.rb', line 121 def method_missing(name, *args) Jscall.__getpipe__.funcall(self, name, args) end |
Instance Method Details
#__get_id ⇒ Object
94 95 96 |
# File 'lib/jscall.rb', line 94 def __get_id @id end |
#async ⇒ Object
98 99 100 |
# File 'lib/jscall.rb', line 98 def async AsyncRemoteRef.new(@id) end |
#async_send(name, *args) ⇒ Object
117 118 119 |
# File 'lib/jscall.rb', line 117 def async_send(name, *args) Jscall.__getpipe__.async_funcall(self, name, args) end |
#send(name, *args) ⇒ Object
override Object#send
113 114 115 |
# File 'lib/jscall.rb', line 113 def send(name, *args) Jscall.__getpipe__.funcall(self, name, args) end |
#then(*args) ⇒ Object
override Object#then
103 104 105 |
# File 'lib/jscall.rb', line 103 def then(*args) send('then', *args) end |
#to_ary ⇒ Object
puts() calls this
108 109 110 |
# File 'lib/jscall.rb', line 108 def to_ary ["#<RemoteRef @id=#{@id}>"] end |