Module: WebkitRemote::Client::Console

Included in:
WebkitRemote::Client
Defined in:
lib/webkit_remote/client/console.rb

Overview

API for the Console domain.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#console_eventsBoolean

Returns true if the debugger generates Console.* events.

Returns:

  • (Boolean)

    true if the debugger generates Console.* events



30
31
32
# File 'lib/webkit_remote/client/console.rb', line 30

def console_events
  @console_events
end

#console_messagesArray<WebkitRemote::Client::ConsoleMessage> (readonly)



33
34
35
# File 'lib/webkit_remote/client/console.rb', line 33

def console_messages
  @console_messages
end

Instance Method Details

#clear_consoleWebkitRemote::Client

Removes all the messages in the console.

Returns:



23
24
25
26
27
# File 'lib/webkit_remote/client/console.rb', line 23

def clear_console
  @rpc.call 'Console.clearMessages'
  console_cleared
  self
end

#console_add_message(message) ⇒ Object



36
37
38
# File 'lib/webkit_remote/client/console.rb', line 36

def console_add_message(message)
  @console_messages << message
end

#console_clearedObject



41
42
43
44
# File 'lib/webkit_remote/client/console.rb', line 41

def console_cleared
  @console_messages.each(&:release_params)
  @console_messages.clear
end

#initialize_consoleObject



47
48
49
50
# File 'lib/webkit_remote/client/console.rb', line 47

def initialize_console
  @console_events = false
  @console_messages = []
end