Class: BiDiGenerate::Param Private

Inherits:
Struct
  • Object
show all
Defined in:
rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

ruby_name is the snake_case keyword argument; wire_name is the exact key the protocol expects (baked verbatim from the schema, no runtime conversion). enum is the allowed-values constant path for an enum-typed param (nil otherwise).

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#enum ⇒ Object

Returns the value of attribute enum

Returns:

  • (Object) —

    the current value of enum



164
165
166
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 164

def enum
  @enum
end

#rbs ⇒ Object

Returns the value of attribute rbs

Returns:

  • (Object) —

    the current value of rbs



164
165
166
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 164

def rbs
  @rbs
end

#required ⇒ Object

Returns the value of attribute required

Returns:

  • (Object) —

    the current value of required



164
165
166
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 164

def required
  @required
end

#ruby_name ⇒ Object

Returns the value of attribute ruby_name

Returns:

  • (Object) —

    the current value of ruby_name



164
165
166
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 164

def ruby_name
  @ruby_name
end

#wire_name ⇒ Object

Returns the value of attribute wire_name

Returns:

  • (Object) —

    the current value of wire_name



164
165
166
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 164

def wire_name
  @wire_name
end

Instance Method Details

#enum_check(indent) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



171
172
173
174
175
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 171

def enum_check(indent)
  return unless enum

  BiDiGenerate.wrap_call('Serialization.validate!', ["'#{wire_name}'", ruby_name, enum], indent)
end

#rbs_part ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

An RBS keyword parameter carrying the param's value type. The ? prefix marks the keyword omittable; the value type already carries the schema's nullability, so nil is admitted only for a nullable field (a non-nullable one rejects nil at construction).



180
181
182
183
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 180

def rbs_part
  type = rbs || 'untyped'
  required ? "#{ruby_name}: #{type}" : "?#{ruby_name}: #{type}"
end

#sig_part ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Optionals default to UNSET (omitted), so an explicit nil can still reach a nullable field as wire null.



167
168
169
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 167

def sig_part
  required ? "#{ruby_name}:" : "#{ruby_name}: Serialization::UNSET"
end