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



149
150
151
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 149

def enum
  @enum
end

#rbsObject

Returns the value of attribute rbs

Returns:

  • (Object)

    the current value of rbs



149
150
151
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 149

def rbs
  @rbs
end

#requiredObject

Returns the value of attribute required

Returns:

  • (Object)

    the current value of required



149
150
151
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 149

def required
  @required
end

#ruby_nameObject

Returns the value of attribute ruby_name

Returns:

  • (Object)

    the current value of ruby_name



149
150
151
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 149

def ruby_name
  @ruby_name
end

#wire_nameObject

Returns the value of attribute wire_name

Returns:

  • (Object)

    the current value of wire_name



149
150
151
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 149

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.



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

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



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

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.



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

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