Class: Selenium::DevTools::V149::Tethering
- Inherits:
-
Object
- Object
- Selenium::DevTools::V149::Tethering
- Defined in:
- lib/selenium/devtools/v149/tethering.rb
Constant Summary collapse
- EVENTS =
{ accepted: 'accepted', }.freeze
Instance Method Summary collapse
- #bind(port:) ⇒ Object
-
#initialize(devtools) ⇒ Tethering
constructor
A new instance of Tethering.
- #on(event, &block) ⇒ Object
- #unbind(port:) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ Tethering
Returns a new instance of Tethering.
30 31 32 |
# File 'lib/selenium/devtools/v149/tethering.rb', line 30 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#bind(port:) ⇒ Object
39 40 41 42 |
# File 'lib/selenium/devtools/v149/tethering.rb', line 39 def bind(port:) @devtools.send_cmd('Tethering.bind', port: port) end |
#on(event, &block) ⇒ Object
34 35 36 37 |
# File 'lib/selenium/devtools/v149/tethering.rb', line 34 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["Tethering.#{event}"] << block end |
#unbind(port:) ⇒ Object
44 45 46 47 |
# File 'lib/selenium/devtools/v149/tethering.rb', line 44 def unbind(port:) @devtools.send_cmd('Tethering.unbind', port: port) end |