Class: ChromeRemoteDebug::Command

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

Constant Summary collapse

@@id =
1

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method, params = {}) ⇒ Command

Returns a new instance of Command.



11
12
13
14
15
16
# File 'lib/chrome_remote_debug/command.rb', line 11

def initialize(method, params = {})
  @method = method
  @params = params
  @id = @@id
  @@id += 1
end

Class Method Details

.reset_idObject



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

def self.reset_id
  @@id = 1
end

Instance Method Details

#idObject



18
19
20
# File 'lib/chrome_remote_debug/command.rb', line 18

def id
  @id
end

#to_json(*a) ⇒ Object



22
23
24
# File 'lib/chrome_remote_debug/command.rb', line 22

def to_json(*a)
  { "id" => id, "method" => @method, "params" => @params }.to_json(*a)
end