Class: BiDiGenerate::VendorModule 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 namespaced group of browser-specific command extensions (e.g. Firefox's moz: fields), emitted as a subclass of the domain that overrides the extended commands. A subclass (rather than a runtime-mixed module) keeps the vendor signatures statically visible to type checkers, and is constructed directly (<Name>.new(source)) for a matching session — no factory or runtime mix-in.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commandsObject

Returns the value of attribute commands

Returns:

  • (Object)

    the current value of commands



286
287
288
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 286

def commands
  @commands
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



286
287
288
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 286

def name
  @name
end

#namespaceObject

Returns the value of attribute namespace

Returns:

  • (Object)

    the current value of namespace



286
287
288
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 286

def namespace
  @namespace
end

#parentObject

Returns the value of attribute parent

Returns:

  • (Object)

    the current value of parent



286
287
288
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 286

def parent
  @parent
end

Instance Method Details

#render(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.



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 287

def render(indent)
  pad = ' ' * indent
  lines = [
    "#{pad}# @api private",
    "#{pad}# #{namespace}: vendor variant of #{parent}, overriding commands with browser-specific params.",
    "#{pad}# Construct #{name}.new(source) for a matching session; other sessions use #{parent}.",
    "#{pad}class #{name} < #{parent}"
  ]
  commands.each_with_index do |cmd, index|
    lines << '' unless index.zero?
    lines.concat(cmd.render_lines(indent + 2))
  end
  lines << "#{pad}end"
  lines.join("\n")
end