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

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 collapse

Instance Method Summary collapse

Instance Attribute Details

#modeObject

Returns the value of attribute mode

Returns:

  • (Object)

    the current value of mode



333
334
335
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 333

def mode
  @mode
end

#refObject

Returns the value of attribute ref

Returns:

  • (Object)

    the current value of ref



333
334
335
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 333

def ref
  @ref
end

#requiresObject

Returns the value of attribute requires

Returns:

  • (Object)

    the current value of requires



333
334
335
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 333

def requires
  @requires
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



333
334
335
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 333

def value
  @value
end

Instance Method Details

#discriminator_pairObject

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.

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



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

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

#symbolic?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.

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

Returns:

  • (Boolean)


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

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

#variant_entryObject

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 variant table entry: sym: 'Ref' for a string tag, else true => 'Ref'.



338
339
340
341
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 338

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