Class: BiDiGenerate::FieldIR Private
- Inherits:
-
Struct
- Object
- Struct
- BiDiGenerate::FieldIR
- 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.
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 collapse
-
#enum ⇒ Object
Returns the value of attribute enum.
-
#list ⇒ Object
Returns the value of attribute list.
-
#nullable ⇒ Object
Returns the value of attribute nullable.
-
#primitive ⇒ Object
Returns the value of attribute primitive.
-
#rbs ⇒ Object
Returns the value of attribute rbs.
-
#ref ⇒ Object
Returns the value of attribute ref.
-
#required ⇒ Object
Returns the value of attribute required.
-
#ruby_name ⇒ Object
Returns the value of attribute ruby_name.
-
#wire_key ⇒ Object
Returns the value of attribute wire_key.
Instance Method Summary collapse
-
#rbs_arg ⇒ Object
private
The
self.newkeyword for this field — a user-supplied input carrying the field's value type. -
#rbs_reader ⇒ Object
private
The
attr_readertype. -
#spec_entry(indent = 0) ⇒ Object
private
A
Serialization::Record.definespec entry:name: 'jsonKey'shorthand, orname: {wire_key:, …}when the field carries JSON facts beyond its name.
Instance Attribute Details
#enum ⇒ Object
Returns the value of attribute enum
238 239 240 |
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 238 def enum @enum end |
#list ⇒ Object
Returns the value of attribute list
238 239 240 |
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 238 def list @list end |
#nullable ⇒ Object
Returns the value of attribute nullable
238 239 240 |
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 238 def nullable @nullable end |
#primitive ⇒ Object
Returns the value of attribute primitive
238 239 240 |
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 238 def primitive @primitive end |
#rbs ⇒ Object
Returns the value of attribute rbs
238 239 240 |
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 238 def rbs @rbs end |
#ref ⇒ Object
Returns the value of attribute ref
238 239 240 |
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 238 def ref @ref end |
#required ⇒ Object
Returns the value of attribute required
238 239 240 |
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 238 def required @required end |
#ruby_name ⇒ Object
Returns the value of attribute ruby_name
238 239 240 |
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 238 def ruby_name @ruby_name end |
#wire_key ⇒ Object
Returns the value of attribute wire_key
238 239 240 |
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 238 def wire_key @wire_key end |
Instance Method Details
#rbs_arg ⇒ 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.
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.
260 261 262 |
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 260 def rbs_arg required ? "#{ruby_name}: #{rbs}" : "?#{ruby_name}: #{rbs}" end |
#rbs_reader ⇒ 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.
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.
266 267 268 |
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 266 def rbs_reader "#{ruby_name}: #{required ? rbs : 'untyped'}" end |
#spec_entry(indent = 0) ⇒ 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.
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.
243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 243 def spec_entry(indent = 0) = [] << 'required: false' unless required << 'nullable: true' if nullable << "ref: '#{ref}'" if ref << 'list: true' if list << "enum: '#{enum}'" if enum << "primitive: '#{primitive}'" if primitive return "#{ruby_name}: '#{wire_key}'" if .empty? .unshift("wire_key: '#{wire_key}'") BiDiGenerate.wrap_call("#{ruby_name}: ", , indent, open: '{', close: '}') end |