Skip to content

Commit acb0ccd

Browse files
committed
make private api
1 parent 7f22cdc commit acb0ccd

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

rb/lib/selenium/webdriver/common/types/data.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,21 @@
2020
module Selenium
2121
module WebDriver
2222
module Types
23+
#
24+
# A subclass of ::Data that allows optional, unordered, camel-cased key-value pairs.
25+
#
26+
# @api private
27+
#
2328
class Data < ::Data
2429
def self.define(*members, &blk)
2530
klass = super(*members.map(&:to_sym), &blk)
2631

27-
klass.singleton_class.prepend(Module.new {
32+
klass.singleton_class.prepend(Module.new do
2833
def new(*args, **opts)
2934
norm = WebDriver::Types.normalize_args(args, opts)
3035
super(*members.map { |m| norm[m] })
3136
end
32-
})
37+
end)
3338

3439
klass
3540
end

rb/lib/selenium/webdriver/common/types/struct.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,20 @@ module WebDriver
2222
module Types
2323
class Struct < ::Struct
2424
class << self
25+
#
26+
# A subclass of ::Struct that allows optional, unordered, camel-cased key-value pairs.
27+
#
28+
# @api private
29+
#
2530
def define(*members, &blk)
2631
klass = super(*members.map(&:to_sym), keyword_init: true, &blk)
2732

28-
klass.singleton_class.prepend(Module.new {
33+
klass.singleton_class.prepend(Module.new do
2934
def new(*args, **opts)
3035
norm = WebDriver::Types.normalize_args(args, opts)
3136
super(**members.to_h { |m| [m, norm[m]] })
3237
end
33-
})
38+
end)
3439

3540
klass
3641
end

0 commit comments

Comments
 (0)