We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af88f87 commit fe3fb6bCopy full SHA for fe3fb6b
lib/ferrum/client.rb
@@ -23,7 +23,10 @@ def initialize(ws_url, options)
23
24
def command(method, async: false, **params)
25
message = build_message(method, params)
26
+ send_message(message, async: async)
27
+ end
28
29
+ def send_message(message, async:)
30
if async
31
@ws.send_message(message)
32
true
@@ -66,6 +69,10 @@ def inspect
66
69
"@ws=#{@ws.inspect}>"
67
70
end
68
71
72
+ def build_message(method, params)
73
+ { method: method, params: params }.merge(id: next_command_id)
74
75
+
76
private
77
78
def start
@@ -83,10 +90,6 @@ def start
83
90
84
91
85
92
86
- def build_message(method, params)
87
- { method: method, params: params }.merge(id: next_command_id)
88
- end
89
-
93
def next_command_id
94
@command_id += 1
95
0 commit comments