Skip to content

Commit 8787787

Browse files
committed
Ruby 3 compatibility
1 parent 761365c commit 8787787

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/ferrum/page.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,13 @@ def position
113113
@browser.command("Browser.getWindowBounds", windowId: window_id).fetch("bounds").values_at("left", "top")
114114
end
115115

116-
def position=(left:, top:)
116+
def position=(*args)
117+
if args.size == 1
118+
left = args[0][:left]
119+
top = args[0][:top]
120+
else
121+
raise "Use like: browser.position = { left: 1, right: 2}"
122+
end
117123
@browser.command("Browser.setWindowBounds", windowId: window_id, bounds: { left: left, top: top })
118124
end
119125

0 commit comments

Comments
 (0)