Class: Puppeteer::Connection::MessageCallback

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

Overview

callback object stored in @callbacks.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method:, promise:) ⇒ MessageCallback

Returns a new instance of MessageCallback.

Parameters:

  • method (String)
  • promise (Async::Promise)


24
25
26
27
# File 'lib/puppeteer/connection.rb', line 24

def initialize(method:, promise:)
  @method = method
  @promise = promise
end

Instance Attribute Details

#methodObject (readonly)

Returns the value of attribute method.



37
38
39
# File 'lib/puppeteer/connection.rb', line 37

def method
  @method
end

Instance Method Details

#reject(error) ⇒ Object



33
34
35
# File 'lib/puppeteer/connection.rb', line 33

def reject(error)
  @promise.reject(error)
end

#resolve(result) ⇒ Object



29
30
31
# File 'lib/puppeteer/connection.rb', line 29

def resolve(result)
  @promise.resolve(result)
end