Class: BiDiGenerate::UnionClass Private

Inherits:
Struct
  • Object
show all
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.

A generated discriminated union (< Serialization::Union, resolved by lexical scope). nested holds its synthetic variant records (see nest_synthetic).

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#discriminator_wireObject

Returns the value of attribute discriminator_wire

Returns:

  • (Object)

    the current value of discriminator_wire



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

def discriminator_wire
  @discriminator_wire
end

#nestedObject

Returns the value of attribute nested

Returns:

  • (Object)

    the current value of nested



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

def nested
  @nested
end

#ruby_nameObject

Returns the value of attribute ruby_name

Returns:

  • (Object)

    the current value of ruby_name



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

def ruby_name
  @ruby_name
end

#schema_nameObject

Returns the value of attribute schema_name

Returns:

  • (Object)

    the current value of schema_name



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

def schema_name
  @schema_name
end

#variantsObject

Returns the value of attribute variants

Returns:

  • (Object)

    the current value of variants



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

def variants
  @variants
end

Instance Method Details

#discriminator_decl(indent) ⇒ 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.

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



360
361
362
363
364
365
366
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 360

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_variantObject

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.



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

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

#nested_typesObject

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.



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

def nested_types = nested || []

#presence_variantsObject

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.



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

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

#union?Boolean

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.

Returns:

  • (Boolean)


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

def union? = true

#value_variantsObject

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.



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

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