Class: Puppeteer::Bidi::ReactorRunner::Proxy
- Inherits:
-
SimpleDelegator
show all
- Defined in:
- lib/puppeteer/bidi/reactor_runner.rb,
sig/puppeteer/bidi/reactor_runner.rbs
Instance Method Summary
collapse
#__getobj__, #__setobj__
Constructor Details
#initialize(runner, target, owns_runner: false) ⇒ Proxy
Returns a new instance of Proxy.
30
31
32
33
34
|
# File 'lib/puppeteer/bidi/reactor_runner.rb', line 30
def initialize(runner, target, owns_runner: false)
super(target)
@runner = runner
@owns_runner = owns_runner
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, **kwargs, &block) ⇒ void
This method returns an undefined value.
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/puppeteer/bidi/reactor_runner.rb', line 36
def method_missing(name, *args, **kwargs, &block)
if @owns_runner && @runner.closed? && close_like?(name)
return nil
end
begin
@runner.sync do
args = args.map { |arg| @runner.unwrap(arg) }
kwargs = kwargs.transform_values { |value| @runner.unwrap(value) }
result = __getobj__.public_send(name, *args, **kwargs, &block)
@runner.wrap(result)
end
ensure
@runner.close if @owns_runner && close_like?(name)
end
end
|
Instance Method Details
#==(other) ⇒ Object
71
72
73
|
# File 'lib/puppeteer/bidi/reactor_runner.rb', line 71
def ==(other)
__getobj__ == @runner.unwrap(other)
end
|
#class ⇒ Object
57
58
59
|
# File 'lib/puppeteer/bidi/reactor_runner.rb', line 57
def class
__getobj__.class
end
|
#close_like?(name) ⇒ Boolean
85
86
87
|
# File 'lib/puppeteer/bidi/reactor_runner.rb', line 85
def close_like?(name)
name == :close || name == :disconnect
end
|
#eql?(other) ⇒ Boolean
75
76
77
|
# File 'lib/puppeteer/bidi/reactor_runner.rb', line 75
def eql?(other)
__getobj__.eql?(@runner.unwrap(other))
end
|
#hash ⇒ Object
79
80
81
|
# File 'lib/puppeteer/bidi/reactor_runner.rb', line 79
def hash
__getobj__.hash
end
|
#instance_of?(klass) ⇒ Boolean
67
68
69
|
# File 'lib/puppeteer/bidi/reactor_runner.rb', line 67
def instance_of?(klass)
__getobj__.instance_of?(klass)
end
|
#is_a?(klass) ⇒ Boolean
Also known as:
kind_of?
61
62
63
|
# File 'lib/puppeteer/bidi/reactor_runner.rb', line 61
def is_a?(klass)
__getobj__.is_a?(klass)
end
|
#respond_to_missing?(name, include_private = false) ⇒ Boolean
53
54
55
|
# File 'lib/puppeteer/bidi/reactor_runner.rb', line 53
def respond_to_missing?(name, include_private = false)
__getobj__.respond_to?(name, include_private) || super
end
|