Class: Puppeteer::Connection::MessageCallback
- Inherits:
-
Object
- Object
- Puppeteer::Connection::MessageCallback
- Defined in:
- lib/puppeteer/connection.rb
Overview
callback object stored in @callbacks.
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
-
#initialize(method:, promise:) ⇒ MessageCallback
constructor
A new instance of MessageCallback.
- #reject(error) ⇒ Object
- #resolve(result) ⇒ Object
Constructor Details
#initialize(method:, promise:) ⇒ MessageCallback
Returns a new instance of MessageCallback.
23 24 25 26 |
# File 'lib/puppeteer/connection.rb', line 23 def initialize(method:, promise:) @method = method @promise = promise end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
36 37 38 |
# File 'lib/puppeteer/connection.rb', line 36 def method @method end |
Instance Method Details
#reject(error) ⇒ Object
32 33 34 |
# File 'lib/puppeteer/connection.rb', line 32 def reject(error) @promise.reject(error) end |
#resolve(result) ⇒ Object
28 29 30 |
# File 'lib/puppeteer/connection.rb', line 28 def resolve(result) @promise.fulfill(result) end |