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

payload_ref is the Protocol-relative class the event's params parse into (nil when non-structured, dispatched raw) — the inbound counterpart to a command's result_ref.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#event_name ⇒ Object

Returns the value of attribute event_name

Returns:

  • (Object) —

    the current value of event_name



299
300
301
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 299

def event_name
  @event_name
end

#payload_ref ⇒ Object

Returns the value of attribute payload_ref

Returns:

  • (Object) —

    the current value of payload_ref



299
300
301
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 299

def payload_ref
  @payload_ref
end

#spec_href ⇒ Object

Returns the value of attribute spec_href

Returns:

  • (Object) —

    the current value of spec_href



299
300
301
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 299

def spec_href
  @spec_href
end

#wire_name ⇒ Object

Returns the value of attribute wire_name

Returns:

  • (Object) —

    the current value of wire_name



299
300
301
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 299

def wire_name
  @wire_name
end

Instance Method Details

#listener_method ⇒ 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.



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

def listener_method = "add_#{event_name}_listener"

#rbs_signature ⇒ 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.



314
315
316
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 314

def rbs_signature
  "() { (#{payload_ref || 'Hash[String, untyped]'}) -> void } -> String"
end

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



305
306
307
308
309
310
311
312
# File 'lib/selenium/webdriver/bidi/support/bidi_generate.rb', line 305

def render_lines(indent)
  pad = ' ' * indent
  lines = ["#{pad}# @api private", "#{pad}# @see #{BiDiGenerate::BIDI_DOC_URL}"]
  lines << "#{pad}# @see #{spec_href}" if spec_href
  lines + ["#{pad}def #{listener_method}(&block)",
           "#{pad}  add_listener('#{wire_name}', &block)",
           "#{pad}end"]
end

#type_entry ⇒ 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.

An EVENT_TYPES entry mapping the wire method to the type its params parse into.



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

def type_entry = "'#{wire_name}' => #{payload_ref || 'nil'}"