Skip to content

Commit 15ef477

Browse files
committed
transform serialize to as_json
1 parent acce734 commit 15ef477

File tree

14 files changed

+38
-38
lines changed

14 files changed

+38
-38
lines changed

rb/lib/selenium/webdriver/bidi/network/cookies.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def initialize(cookies = {})
2626
merge!(cookies)
2727
end
2828

29-
def serialize
29+
def as_json
3030
map do |name, value|
3131
{
3232
name: name.to_s,

rb/lib/selenium/webdriver/bidi/network/credentials.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def initialize(username: nil, password: nil)
2828
@password = password
2929
end
3030

31-
def serialize
31+
def as_json
3232
return nil unless username && password
3333

3434
{

rb/lib/selenium/webdriver/bidi/network/headers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module Selenium
2121
module WebDriver
2222
class BiDi
2323
class Headers < Hash
24-
def serialize
24+
def as_json
2525
map do |name, val|
2626
{
2727
name: name.to_s,

rb/lib/selenium/webdriver/bidi/network/intercepted_request.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def continue
3838
network.continue_request(
3939
id: id,
4040
body: body,
41-
cookies: cookies.serialize,
42-
headers: headers.serialize,
41+
cookies: cookies.as_json,
42+
headers: headers.as_json,
4343
method: method,
4444
url: url
4545
)

rb/lib/selenium/webdriver/bidi/network/intercepted_response.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ def initialize(network, request)
3535
def continue
3636
network.continue_response(
3737
id: id,
38-
cookies: set_cookie_headers.serialize,
39-
headers: headers.serialize,
40-
credentials: credentials.serialize,
38+
cookies: set_cookie_headers.as_json,
39+
headers: headers.as_json,
40+
credentials: credentials.as_json,
4141
reason: reason
4242
)
4343
end

rb/lib/selenium/webdriver/bidi/network/set_cookie_headers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def initialize(set_cookie_headers = {})
2626
merge!(set_cookie_headers)
2727
end
2828

29-
def serialize
29+
def as_json
3030
map do |name, data|
3131
data = {value: data} unless data.is_a?(Hash)
3232

rb/sig/lib/selenium/webdriver/bidi/network/cookies.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Selenium
44
class Cookies
55
def initialize: (Hash[Symbol, String] cookies) -> void
66

7-
def serialize: () -> Hash[Symbol, String]
7+
def as_json: () -> Hash[Symbol, String]
88
end
99
end
1010
end

rb/sig/lib/selenium/webdriver/bidi/network/credentials.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module Selenium
1212

1313
def initialize: (?username: String?, ?password: String?) -> void
1414

15-
def serialize: () -> Hash[Symbol, String]?
15+
def as_json: () -> Hash[Symbol, String]?
1616
end
1717
end
1818
end

rb/sig/lib/selenium/webdriver/bidi/network/headers.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Selenium
44
class Headers
55
def initialize: () -> void
66

7-
def serialize: () -> Array[Hash[Symbol, String]]
7+
def as_json: () -> Array[Hash[Symbol, String]]
88
end
99
end
1010
end

rb/sig/lib/selenium/webdriver/bidi/network/set_cookie_headers.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Selenium
44
class SetCookieHeaders
55
def initialize: (Hash[Symbol, untyped] set_cookie_headers) -> void
66

7-
def serialize: () -> Array[Hash[Symbol, untyped]]
7+
def as_json: () -> Array[Hash[Symbol, untyped]]
88
end
99
end
1010
end

0 commit comments

Comments
 (0)