Class: Selenium::DevTools::V129::Tethering

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v129/tethering.rb

Constant Summary collapse

EVENTS =
{
  accepted: 'accepted',
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ Tethering

Returns a new instance of Tethering.



29
30
31
# File 'lib/selenium/devtools/v129/tethering.rb', line 29

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#bind(port:) ⇒ Object



38
39
40
41
# File 'lib/selenium/devtools/v129/tethering.rb', line 38

def bind(port:)
  @devtools.send_cmd('Tethering.bind',
                     port: port)
end

#on(event, &block) ⇒ Object



33
34
35
36
# File 'lib/selenium/devtools/v129/tethering.rb', line 33

def on(event, &block)
  event = EVENTS[event] if event.is_a?(Symbol)
  @devtools.callbacks["Tethering.#{event}"] << block
end

#unbind(port:) ⇒ Object



43
44
45
46
# File 'lib/selenium/devtools/v129/tethering.rb', line 43

def unbind(port:)
  @devtools.send_cmd('Tethering.unbind',
                     port: port)
end