Class: InvokeMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/opal/drb/invoke_method.rb

Instance Method Summary collapse

Constructor Details

#initialize(drb_server, client) ⇒ InvokeMethod

Returns a new instance of InvokeMethod.



2
3
4
5
# File 'lib/opal/drb/invoke_method.rb', line 2

def initialize(drb_server, client)
  @drb_server = drb_server
  @client = client
end

Instance Method Details

#performObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/opal/drb/invoke_method.rb', line 7

def perform
  @result = nil
  @succ = false

  setup_message

  if @block
    @result = perform_with_block
  else
    @result = perform_without_block
  end

  @succ = true
  if @msg_id == :to_ary && @result.class == Array
    @result = DRbArray.new(@result)
  end
  return @succ, @result
rescue StandardError, ScriptError, Interrupt
  @result = $!
  return @succ, @result
end