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.



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

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.



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

def args
  @args
end

#timestampObject

Returns the value of attribute timestamp.



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

def timestamp
  @timestamp
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end