123456789_123456789_123456789_123456789_123456789_

Class: BiDiGenerate::VariantIR 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

mode is :value (matched by discriminator), :fallback (the no-tag variant), or :presence (selected when its required wire keys are all present).

Instance Attribute Summary

  • #mode rw Internal use only

    mode is :value (matched by discriminator), :fallback (the no-tag variant), or :presence (selected when its required wire keys are all present).

  • #ref rw Internal use only

    mode is :value (matched by discriminator), :fallback (the no-tag variant), or :presence (selected when its required wire keys are all present).

  • #requires rw Internal use only

    mode is :value (matched by discriminator), :fallback (the no-tag variant), or :presence (selected when its required wire keys are all present).

  • #value rw Internal use only

    mode is :value (matched by discriminator), :fallback (the no-tag variant), or :presence (selected when its required wire keys are all present).

Instance Method Summary

  • #discriminator_pair Internal use only
    sym: 'wireToken' feeding the union's inbound wire->symbol map (string tags only).
  • #symbolic? ⇒ Boolean Internal use only

    A string tag becomes an idiomatic symbol key; a bool/number tag stays a literal.

  • #variant_entry Internal use only

    The variant table entry: sym: 'Ref' for a string tag, else true => 'Ref'.

Instance Attribute Details

#mode (rw)

mode is :value (matched by discriminator), :fallback (the no-tag variant), or :presence (selected when its required wire keys are all present).

[ GitHub ]

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

VariantIR = Struct.new(:mode, :value, :ref, :requires, keyword_init: true)

#ref (rw)

mode is :value (matched by discriminator), :fallback (the no-tag variant), or :presence (selected when its required wire keys are all present).

[ GitHub ]

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

VariantIR = Struct.new(:mode, :value, :ref, :requires, keyword_init: true)

#requires (rw)

mode is :value (matched by discriminator), :fallback (the no-tag variant), or :presence (selected when its required wire keys are all present).

[ GitHub ]

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

VariantIR = Struct.new(:mode, :value, :ref, :requires, keyword_init: true)

#value (rw)

mode is :value (matched by discriminator), :fallback (the no-tag variant), or :presence (selected when its required wire keys are all present).

[ GitHub ]

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

VariantIR = Struct.new(:mode, :value, :ref, :requires, keyword_init: true)

Instance Method Details

#discriminator_pair

sym: 'wireToken' feeding the union's inbound wire->symbol map (string tags only).

[ GitHub ]

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

def discriminator_pair
  "#{BiDiGenerate.enum_key(value)}: '#{value}'" if symbolic?
end

#symbolic?Boolean

A string tag becomes an idiomatic symbol key; a bool/number tag stays a literal.

[ GitHub ]

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

def symbolic? = value.is_a?(::String)

#variant_entry

The variant table entry: sym: 'Ref' for a string tag, else true => 'Ref'.

[ GitHub ]

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

def variant_entry
  key = symbolic? ? "#{BiDiGenerate.enum_key(value)}:" : "#{BiDiGenerate.ruby_literal(value)} =>"
  "#{key} '#{ref}'"
end