Class: Jscall::RemoteRef

Inherits:
Object
  • Object
show all
Defined in:
lib/jscall.rb

Direct Known Subclasses

AsyncRemoteRef

Instance Method Summary collapse

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_idObject



94
95
96
# File 'lib/jscall.rb', line 94

def __get_id
    @id
end

#asyncObject



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_aryObject

puts() calls this



108
109
110
# File 'lib/jscall.rb', line 108

def to_ary
    ["#<RemoteRef @id=#{@id}>"]
end