123456789_123456789_123456789_123456789_123456789_

Class: BiDiGenerate::FieldIR Private

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Struct
Instance Chain:
self, Struct
Inherits: Struct
  • Object
Defined in: rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb

Overview

ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array. wire_key is the exact JSON payload key (the schema's wire name, baked verbatim).

Instance Attribute Summary

  • #enum rw Internal use only

    ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array.

  • #list rw Internal use only

    ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array.

  • #nullable rw Internal use only

    ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array.

  • #primitive rw Internal use only

    ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array.

  • #rbs rw Internal use only

    ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array.

  • #ref rw Internal use only

    ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array.

  • #required rw Internal use only

    ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array.

  • #ruby_name rw Internal use only

    ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array.

  • #scalar rw Internal use only

    ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array.

  • #wire_key rw Internal use only

    ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array.

Instance Method Summary

  • #rbs_arg Internal use only

    The self.new keyword for this field — a user-supplied input carrying the field's value type.

  • #rbs_reader Internal use only

    The attr_reader type.

  • #scalar_literal Internal use only

    The #scalar primitive(s) a bare non-object wire value must match at a scalar-tolerant union position: a single primitive string, or an array when the union's scalar arms differ.

  • #spec_entry(indent = 0) Internal use only

    A Serialization::Record.define spec entry: name: 'jsonKey' shorthand, or name: {wire_key:, …} when the field carries JSON facts beyond its name.

Instance Attribute Details

#enum (rw)

ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array. wire_key is the exact JSON payload key (the schema's wire name, baked verbatim).

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 239

FieldIR = Struct.new(:ruby_name, :wire_key, :required, :nullable, :ref, :list, :enum, :primitive, :scalar, :rbs,
keyword_init: true)

#list (rw)

ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array. wire_key is the exact JSON payload key (the schema's wire name, baked verbatim).

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 239

FieldIR = Struct.new(:ruby_name, :wire_key, :required, :nullable, :ref, :list, :enum, :primitive, :scalar, :rbs,
keyword_init: true)

#nullable (rw)

ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array. wire_key is the exact JSON payload key (the schema's wire name, baked verbatim).

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 239

FieldIR = Struct.new(:ruby_name, :wire_key, :required, :nullable, :ref, :list, :enum, :primitive, :scalar, :rbs,
keyword_init: true)

#primitive (rw)

ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array. wire_key is the exact JSON payload key (the schema's wire name, baked verbatim).

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 239

FieldIR = Struct.new(:ruby_name, :wire_key, :required, :nullable, :ref, :list, :enum, :primitive, :scalar, :rbs,
keyword_init: true)

#rbs (rw)

ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array. wire_key is the exact JSON payload key (the schema's wire name, baked verbatim).

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 239

FieldIR = Struct.new(:ruby_name, :wire_key, :required, :nullable, :ref, :list, :enum, :primitive, :scalar, :rbs,
keyword_init: true)

#ref (rw)

ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array. wire_key is the exact JSON payload key (the schema's wire name, baked verbatim).

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 239

FieldIR = Struct.new(:ruby_name, :wire_key, :required, :nullable, :ref, :list, :enum, :primitive, :scalar, :rbs,
keyword_init: true)

#required (rw)

ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array. wire_key is the exact JSON payload key (the schema's wire name, baked verbatim).

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 239

FieldIR = Struct.new(:ruby_name, :wire_key, :required, :nullable, :ref, :list, :enum, :primitive, :scalar, :rbs,
keyword_init: true)

#ruby_name (rw)

ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array. wire_key is the exact JSON payload key (the schema's wire name, baked verbatim).

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 239

FieldIR = Struct.new(:ruby_name, :wire_key, :required, :nullable, :ref, :list, :enum, :primitive, :scalar, :rbs,
keyword_init: true)

#scalar (rw)

ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array. wire_key is the exact JSON payload key (the schema's wire name, baked verbatim).

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 239

FieldIR = Struct.new(:ruby_name, :wire_key, :required, :nullable, :ref, :list, :enum, :primitive, :scalar, :rbs,
keyword_init: true)

#wire_key (rw)

ref is the Protocol-relative class path for a nested structured field (nil for a scalar/opaque field); list wraps it in an array. wire_key is the exact JSON payload key (the schema's wire name, baked verbatim).

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 239

FieldIR = Struct.new(:ruby_name, :wire_key, :required, :nullable, :ref, :list, :enum, :primitive, :scalar, :rbs,
keyword_init: true)

Instance Method Details

#rbs_arg

The self.new keyword for this field — a user-supplied input carrying the field's value type. The ? prefix marks the field omittable; its value type already carries the schema's nullability, so nil is admitted only for a nullable field.

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 268

def rbs_arg
  required ? "#{ruby_name}: #{rbs}" : "?#{ruby_name}: #{rbs}"
end

#rbs_reader

The attr_reader type. A present value is #rbs; an omitted optional reads back the UNSET sentinel, which a value type can't capture, so optionals stay untyped.

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 274

def rbs_reader
  "#{ruby_name}: #{required ? rbs : 'untyped'}"
end

#scalar_literal

The #scalar primitive(s) a bare non-object wire value must match at a scalar-tolerant union position: a single primitive string, or an array when the union's scalar arms differ.

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 261

def scalar_literal
  scalar.is_a?(::Array) ? "[#{scalar.map { |s| "'#{s}'" }.join(', ')}]" : "'#{scalar}'"
end

#spec_entry(indent = 0)

A Serialization::Record.define spec entry: name: 'jsonKey' shorthand, or name: {wire_key:, …} when the field carries JSON facts beyond its name. enum carries the allowed-values constant path, validated at construction.

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 244

def spec_entry(indent = 0)
  meta = []
  meta << 'required: false' unless required
  meta << 'nullable: true' if nullable
  meta << "ref: '#{ref}'" if ref
  meta << 'list: true' if list
  meta << "scalar: #{scalar_literal}" if scalar
  meta << "enum: '#{enum}'" if enum
  meta << "primitive: '#{primitive}'" if primitive
  return "#{ruby_name}: '#{wire_key}'" if meta.empty?

  meta.unshift("wire_key: '#{wire_key}'")
  BiDiGenerate.wrap_call("#{ruby_name}: ", meta, indent, open: '{', close: '}')
end