Class: BiDiGenerate::Param Private

Inherits:
Struct
  • Object
show all
Defined in:
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

#enumObject

Returns the value of attribute enum

Returns:

  • (Object)

    the current value of enum



153
154
155
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 153

def enum
  @enum
end

#rbsObject

Returns the value of attribute rbs

Returns:

  • (Object)

    the current value of rbs



153
154
155
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 153

def rbs
  @rbs
end

#requiredObject

Returns the value of attribute required

Returns:

  • (Object)

    the current value of required



153
154
155
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 153

def required
  @required
end

#ruby_nameObject

Returns the value of attribute ruby_name

Returns:

  • (Object)

    the current value of ruby_name



153
154
155
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 153

def ruby_name
  @ruby_name
end

#wire_nameObject

Returns the value of attribute wire_name

Returns:

  • (Object)

    the current value of wire_name



153
154
155
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 153

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.



160
161
162
163
164
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 160

def enum_check(indent)
  return unless enum

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

#rbs_partObject

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).



169
170
171
172
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 169

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

#sig_partObject

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.



156
157
158
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 156

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