123456789_123456789_123456789_123456789_123456789_

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

A generated discriminated union (< Serialization::Union, resolved by lexical scope). nested holds its synthetic variant records (see nest_synthetic). spec_href links to the union's definition in the live spec (nil when the schema has none). object_only mirrors the schema's objectOnly signal: when true, a non-Hash payload is rejected rather than passed through (every arm is an object, so it can match no variant).

Instance Attribute Summary

  • #discriminator_wire rw Internal use only

    A generated discriminated union (< Serialization::Union, resolved by lexical scope).

  • #nested rw Internal use only

    A generated discriminated union (< Serialization::Union, resolved by lexical scope).

  • #object_only rw Internal use only

    A generated discriminated union (< Serialization::Union, resolved by lexical scope).

  • #ruby_name rw Internal use only

    A generated discriminated union (< Serialization::Union, resolved by lexical scope).

  • #schema_name rw Internal use only

    A generated discriminated union (< Serialization::Union, resolved by lexical scope).

  • #spec_href rw Internal use only

    A generated discriminated union (< Serialization::Union, resolved by lexical scope).

  • #union? ⇒ Boolean readonly Internal use only
  • #variants rw Internal use only

    A generated discriminated union (< Serialization::Union, resolved by lexical scope).

Instance Method Summary

Instance Attribute Details

#discriminator_wire (rw)

A generated discriminated union (< Serialization::Union, resolved by lexical scope). nested holds its synthetic variant records (see nest_synthetic). spec_href links to the union's definition in the live spec (nil when the schema has none). object_only mirrors the schema's objectOnly signal: when true, a non-Hash payload is rejected rather than passed through (every arm is an object, so it can match no variant).

[ GitHub ]

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

UnionClass = Struct.new(:ruby_name, :discriminator_wire, :variants, :schema_name, :nested, :spec_href, :object_only,
keyword_init: true)

#nested (rw)

A generated discriminated union (< Serialization::Union, resolved by lexical scope). nested holds its synthetic variant records (see nest_synthetic). spec_href links to the union's definition in the live spec (nil when the schema has none). object_only mirrors the schema's objectOnly signal: when true, a non-Hash payload is rejected rather than passed through (every arm is an object, so it can match no variant).

[ GitHub ]

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

UnionClass = Struct.new(:ruby_name, :discriminator_wire, :variants, :schema_name, :nested, :spec_href, :object_only,
keyword_init: true)

#object_only (rw)

A generated discriminated union (< Serialization::Union, resolved by lexical scope). nested holds its synthetic variant records (see nest_synthetic). spec_href links to the union's definition in the live spec (nil when the schema has none). object_only mirrors the schema's objectOnly signal: when true, a non-Hash payload is rejected rather than passed through (every arm is an object, so it can match no variant).

[ GitHub ]

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

UnionClass = Struct.new(:ruby_name, :discriminator_wire, :variants, :schema_name, :nested, :spec_href, :object_only,
keyword_init: true)

#ruby_name (rw)

A generated discriminated union (< Serialization::Union, resolved by lexical scope). nested holds its synthetic variant records (see nest_synthetic). spec_href links to the union's definition in the live spec (nil when the schema has none). object_only mirrors the schema's objectOnly signal: when true, a non-Hash payload is rejected rather than passed through (every arm is an object, so it can match no variant).

[ GitHub ]

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

UnionClass = Struct.new(:ruby_name, :discriminator_wire, :variants, :schema_name, :nested, :spec_href, :object_only,
keyword_init: true)

#schema_name (rw)

A generated discriminated union (< Serialization::Union, resolved by lexical scope). nested holds its synthetic variant records (see nest_synthetic). spec_href links to the union's definition in the live spec (nil when the schema has none). object_only mirrors the schema's objectOnly signal: when true, a non-Hash payload is rejected rather than passed through (every arm is an object, so it can match no variant).

[ GitHub ]

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

UnionClass = Struct.new(:ruby_name, :discriminator_wire, :variants, :schema_name, :nested, :spec_href, :object_only,
keyword_init: true)

#spec_href (rw)

A generated discriminated union (< Serialization::Union, resolved by lexical scope). nested holds its synthetic variant records (see nest_synthetic). spec_href links to the union's definition in the live spec (nil when the schema has none). object_only mirrors the schema's objectOnly signal: when true, a non-Hash payload is rejected rather than passed through (every arm is an object, so it can match no variant).

[ GitHub ]

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

UnionClass = Struct.new(:ruby_name, :discriminator_wire, :variants, :schema_name, :nested, :spec_href, :object_only,
keyword_init: true)

#union?Boolean (readonly)

[ GitHub ]

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

def union? = true

#variants (rw)

A generated discriminated union (< Serialization::Union, resolved by lexical scope). nested holds its synthetic variant records (see nest_synthetic). spec_href links to the union's definition in the live spec (nil when the schema has none). object_only mirrors the schema's objectOnly signal: when true, a non-Hash payload is rejected rather than passed through (every arm is an object, so it can match no variant).

[ GitHub ]

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

UnionClass = Struct.new(:ruby_name, :discriminator_wire, :variants, :schema_name, :nested, :spec_href, :object_only,
keyword_init: true)

Instance Method Details

#discriminator_decl(indent)

discriminator 'wire', or discriminator 'wire', {sym: 'token', …} (wrapped when long) carrying the inbound wire->symbol map for string-tagged variants.

[ GitHub ]

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

def discriminator_decl(indent)
  pairs = value_variants.filter_map(&:discriminator_pair)
  head = "discriminator '#{discriminator_wire}'"
  return head if pairs.empty?

  BiDiGenerate.wrap_call("#{head}, ", pairs, indent, open: '{', close: '}')
end

#fallback_variant

[ GitHub ]

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

def fallback_variant = variants.find { |v| v.mode == :fallback }

#nested_types

[ GitHub ]

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

def nested_types = nested || []

#presence_variants

[ GitHub ]

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

def presence_variants = variants.select { |v| v.mode == :presence }

#value_variants

[ GitHub ]

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

def value_variants = variants.select { |v| v.mode == :value }