Class: BiDiGenerate::Command Private
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Struct
|
|
|
Instance Chain:
self,
Struct
|
|
| Inherits: |
Struct
|
| Defined in: | rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb |
Overview
params_class is the Parameters class the named args construct (nil for a no-arg
command); union_params picks its variant via .build rather than .new. result_ref
is the Protocol-relative result class path, or nil to return the raw hash.
Instance Attribute Summary
-
#method_name
rw
Internal use only
params_class is the Parameters class the named args construct (nil for a no-arg command); union_params picks its variant via
.buildrather than.new. -
#params
rw
Internal use only
params_class is the Parameters class the named args construct (nil for a no-arg command); union_params picks its variant via
.buildrather than.new. -
#params_class
rw
Internal use only
params_class is the Parameters class the named args construct (nil for a no-arg command); union_params picks its variant via
.buildrather than.new. -
#result_ref
rw
Internal use only
params_class is the Parameters class the named args construct (nil for a no-arg command); union_params picks its variant via
.buildrather than.new. -
#spec_href
rw
Internal use only
params_class is the Parameters class the named args construct (nil for a no-arg command); union_params picks its variant via
.buildrather than.new. -
#union_params
rw
Internal use only
params_class is the Parameters class the named args construct (nil for a no-arg command); union_params picks its variant via
.buildrather than.new. -
#wire_name
rw
Internal use only
params_class is the Parameters class the named args construct (nil for a no-arg command); union_params picks its variant via
.buildrather than.new.
Instance Method Summary
-
#def_header(indent)
Internal use only
def nameordef name(...)— wrapped one argument per line when the signature would exceed the line limit. - #enum_checks(indent) Internal use only
-
#execute_call(indent)
Internal use only
@transport.execute(cmd:[, params: params][, result:]). - #optional_params Internal use only
-
#params_assignment(indent)
Internal use only
The
params = …line built before the execute call, or nil for a no-arg command. - #rbs_params Internal use only
- #rbs_return Internal use only
-
#rbs_signature
Internal use only
The RBS method signature
(params) -> return— the return is the typed result class when the command parses one, elseuntyped. - #required_params Internal use only
Instance Attribute Details
#method_name (rw)
params_class is the Parameters class the named args construct (nil for a no-arg
command); union_params picks its variant via .build rather than .new. result_ref
is the Protocol-relative result class path, or nil to return the raw hash.
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 174
Command = Struct.new(:wire_name, :method_name, :params, :result_ref, :params_class, :union_params, :spec_href, keyword_init: true)
#params (rw)
params_class is the Parameters class the named args construct (nil for a no-arg
command); union_params picks its variant via .build rather than .new. result_ref
is the Protocol-relative result class path, or nil to return the raw hash.
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 174
Command = Struct.new(:wire_name, :method_name, :params, :result_ref, :params_class, :union_params, :spec_href, keyword_init: true)
#params_class (rw)
params_class is the Parameters class the named args construct (nil for a no-arg
command); union_params picks its variant via .build rather than .new. result_ref
is the Protocol-relative result class path, or nil to return the raw hash.
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 174
Command = Struct.new(:wire_name, :method_name, :params, :result_ref, :params_class, :union_params, :spec_href, keyword_init: true)
#result_ref (rw)
params_class is the Parameters class the named args construct (nil for a no-arg
command); union_params picks its variant via .build rather than .new. result_ref
is the Protocol-relative result class path, or nil to return the raw hash.
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 174
Command = Struct.new(:wire_name, :method_name, :params, :result_ref, :params_class, :union_params, :spec_href, keyword_init: true)
#spec_href (rw)
params_class is the Parameters class the named args construct (nil for a no-arg
command); union_params picks its variant via .build rather than .new. result_ref
is the Protocol-relative result class path, or nil to return the raw hash.
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 174
Command = Struct.new(:wire_name, :method_name, :params, :result_ref, :params_class, :union_params, :spec_href, keyword_init: true)
#union_params (rw)
params_class is the Parameters class the named args construct (nil for a no-arg
command); union_params picks its variant via .build rather than .new. result_ref
is the Protocol-relative result class path, or nil to return the raw hash.
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 174
Command = Struct.new(:wire_name, :method_name, :params, :result_ref, :params_class, :union_params, :spec_href, keyword_init: true)
#wire_name (rw)
params_class is the Parameters class the named args construct (nil for a no-arg
command); union_params picks its variant via .build rather than .new. result_ref
is the Protocol-relative result class path, or nil to return the raw hash.
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 174
Command = Struct.new(:wire_name, :method_name, :params, :result_ref, :params_class, :union_params, :spec_href, keyword_init: true)
Instance Method Details
#def_header(indent)
def name or def name(...) — wrapped one argument per line when the signature
would exceed the line limit.
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 182
def def_header(indent) return "def #{method_name}" if params.empty? BiDiGenerate.wrap_call("def #{method_name}", required_params.map(&:sig_part) + optional_params.map(&:sig_part), indent) end
#enum_checks(indent)
[ GitHub ]# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 178
def enum_checks(indent) = params.filter_map { |p| p.enum_check(indent) }
#execute_call(indent)
@transport.execute(cmd:[, params: params][, result:]). The result type is
referenced directly (resolved lazily in the method body, and unambiguous within
Protocol). Params, when present, are the #params local built above.
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 217
def execute_call(indent) args = ["cmd: '#{wire_name}'"] args << 'params: params' unless params.empty? args << "result: #{result_ref}" if result_ref BiDiGenerate.wrap_call('execute', args, indent) end
#optional_params
[ GitHub ]# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 177
def optional_params = params.reject(&:required)
#params_assignment(indent)
The params = … line built before the execute call, or nil for a no-arg command. A
record builds its Parameters object and a union dispatches via .build (whose typed
as_json emits explicit null where a flat hash through Transport could not). Wrapped
one entry per line when long, so it (and the short execute call) stay within the limit.
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 207
def params_assignment(indent) return nil if params.empty? kwargs = params.map { |p| "#{p.ruby_name}: #{p.ruby_name}" } BiDiGenerate.wrap_call("params = #{params_class}.#{union_params ? 'build' : 'new'}", kwargs, indent) end
#rbs_params
[ GitHub ]# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 195
def rbs_params (required_params.map(&:rbs_part) + optional_params.map(&:rbs_part)).join(', ') end
#rbs_return
[ GitHub ]# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 199
def rbs_return result_ref ? "::Selenium::WebDriver::BiDi::Protocol::#{result_ref}" : 'untyped' end
#rbs_signature
The RBS method signature (params) -> return — the return is the typed result class
when the command parses one, else untyped.
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 191
def rbs_signature "(#{rbs_params}) -> #{rbs_return}" end
#required_params
[ GitHub ]# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 176
def required_params = params.select(&:required)