class WebkitRemote::Event::ConsoleMessage
Emitted when a console message is produced.
Attributes
message[R]
@return [WebkitRemote::Client::ConsoleMessage] the new message
Public Class Methods
can_reach?(client)
click to toggle source
@private Use Event#can_receive instead of calling this directly.
# File lib/webkit_remote/client/console_events.rb, line 46 def self.can_reach?(client) client.console_events end
new(rpc_event, client)
click to toggle source
@private Use Event#for instead of calling this constructor directly.
Calls superclass method
WebkitRemote::Event::new
# File lib/webkit_remote/client/console_events.rb, line 33 def initialize(rpc_event, client) super if raw_message = raw_data['message'] @message = WebkitRemote::Client::ConsoleMessage.new raw_data['message'], client client.console_add_message @message else @message = nil end end
Public Instance Methods
level()
click to toggle source
@return [Symbol] message severity
The documented values are :debug, :error, :log, :tip, and :warning.
# File lib/webkit_remote/client/console_events.rb, line 20 def level @message.level end
reason()
click to toggle source
@return [Symbol] the component that produced this message
The documented values are :console_api, :html, :javascript, :network,
:other, :wml, and :xml.
# File lib/webkit_remote/client/console_events.rb, line 28 def reason @message.reason end
text()
click to toggle source
@return [String] the message text
# File lib/webkit_remote/client/console_events.rb, line 13 def text @message.text end