Class: ChromeRemoteDebug::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/chrome_remote_debug/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(host, port) ⇒ Client

Returns a new instance of Client.



6
7
8
9
# File 'lib/chrome_remote_debug/client.rb', line 6

def initialize(host, port)
  @host = host
  @port = port
end

Instance Method Details

#pagesObject



11
12
13
14
# File 'lib/chrome_remote_debug/client.rb', line 11

def pages
  json = Net::HTTP.get(@host, "/json", @port)
  JSON.parse(json).map {|page_spec| Page.new(page_spec)}
end