Class: Selenium::WebDriver::DevTools::ConsoleEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/webdriver/devtools/console_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, timestamp:, args:) ⇒ ConsoleEvent

Returns a new instance of ConsoleEvent.


27
28
29
30
31
32
33
# File 'lib/selenium/webdriver/devtools/console_event.rb', line 27

def initialize(type:, timestamp:, args:)
  @type = type.to_sym
  @timestamp = Time.at(timestamp / 1000)
  @args = args.map do |arg|
    arg.key?('value') ? arg['value'] : arg
  end
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.


25
26
27
# File 'lib/selenium/webdriver/devtools/console_event.rb', line 25

def args
  @args
end

#timestampObject

Returns the value of attribute timestamp.


25
26
27
# File 'lib/selenium/webdriver/devtools/console_event.rb', line 25

def timestamp
  @timestamp
end

#typeObject

Returns the value of attribute type.


25
26
27
# File 'lib/selenium/webdriver/devtools/console_event.rb', line 25

def type
  @type
end