Skip to content

Commit fe3fb6b

Browse files
committed
ref: Preparation for a flatten mode
1 parent af88f87 commit fe3fb6b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/ferrum/client.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ def initialize(ws_url, options)
2323

2424
def command(method, async: false, **params)
2525
message = build_message(method, params)
26+
send_message(message, async: async)
27+
end
2628

29+
def send_message(message, async:)
2730
if async
2831
@ws.send_message(message)
2932
true
@@ -66,6 +69,10 @@ def inspect
6669
"@ws=#{@ws.inspect}>"
6770
end
6871

72+
def build_message(method, params)
73+
{ method: method, params: params }.merge(id: next_command_id)
74+
end
75+
6976
private
7077

7178
def start
@@ -83,10 +90,6 @@ def start
8390
end
8491
end
8592

86-
def build_message(method, params)
87-
{ method: method, params: params }.merge(id: next_command_id)
88-
end
89-
9093
def next_command_id
9194
@command_id += 1
9295
end

0 commit comments

Comments
 (0)