Class: BiDiGenerate::FieldIR 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
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
-
#bounds
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.
-
#const
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.
-
#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.
-
#map_of
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
-
#bound_facts
Internal use only
The numeric bounds every value the field carries is held to (for a list or map, each numeric one).
-
#primitive_literal(value)
Internal use only
A single primitive string, or an array when a value may match several: a union of scalars (#primitive), a scalar-tolerant union position (#scalar), or a map's union of values (
map). -
#rbs_arg
Internal use only
The
self.newkeyword for this field — a user-supplied input carrying the field's value type. -
#rbs_reader
Internal use only
The
attr_readertype. -
#spec_entry(indent = 0, trailing: 0)
Internal use only
A
Serialization::Record.definespec entry:name: 'jsonKey'shorthand, orname: {wire_key:, …}when the field carries JSON facts beyond its name. -
#type_facts
Internal use only
The facts describing the value's type and shape: what the runtime reads it as and checks it against.
-
#value_facts
Internal use only
The JSON facts beyond the field's name, in the order
Record.definereads them.
Instance Attribute Details
#bounds (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).
#const (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).
#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).
#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).
#map_of (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).
#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).
#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).
#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).
#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).
#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).
#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).
#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).
#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).
Instance Method Details
#bound_facts
The numeric bounds every value the field carries is held to (for a list or map, each numeric one).
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 363
def bound_facts bounds.map { |key, value| "#{BiDiGenerate.camel_to_snake(key)}: #{BiDiGenerate.numeric_literal(value)}" } end
#primitive_literal(value)
A single primitive string, or an array when a value may match several: a union of scalars
(#primitive), a scalar-tolerant union position (#scalar), or a map's union of values (map).
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 369
def primitive_literal(value) value.is_a?(::Array) ? BiDiGenerate.word_array(value) : "'#{value}'" end
#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.
#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.
#spec_entry(indent = 0, trailing: 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.
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 329
def spec_entry(indent = 0, trailing: 0) = value_facts return "#{ruby_name}: '#{wire_key}'" if .empty? .unshift("wire_key: '#{wire_key}'") BiDiGenerate.wrap_call("#{ruby_name}: ", , indent, open: '{', close: '}', trailing: trailing) end
#type_facts
The facts describing the value's type and shape: what the runtime reads it as and checks
it against. For a list, ref/scalar/enum/primitive describe each element. #map_of is the
value primitive(s) of a string-keyed map ({*text => text}).
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 351
def type_facts facts = [] facts << "ref: '#{ref}'" if ref facts << 'list: true' if list facts << "scalar: #{primitive_literal(scalar)}" if scalar facts << "enum: '#{enum}'" if enum facts << "primitive: #{primitive_literal(primitive)}" if primitive facts << "map: #{primitive_literal(map_of)}" if map_of facts + bound_facts end
#value_facts
The JSON facts beyond the field's name, in the order Record.define reads them. A
nullable const (literal / null) carries const: so the runtime rejects a value that
is neither the literal nor null; const.nil? means the field has no const at all.
# File 'rb/lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 340
def value_facts facts = [] facts << 'required: false' unless required facts << 'nullable: true' if nullable facts << "const: #{BiDiGenerate.ruby_literal(const)}" unless const.nil? facts + type_facts end