Class: WebkitRemote::Event::ConsoleMessage
- Inherits:
-
WebkitRemote::Event
- Object
- WebkitRemote::Event
- WebkitRemote::Event::ConsoleMessage
- Defined in:
- lib/webkit_remote/client/console_events.rb
Overview
Emitted when a console message is produced.
Instance Attribute Summary collapse
-
#message ⇒ WebkitRemote::Client::ConsoleMessage
readonly
The new message.
Attributes inherited from WebkitRemote::Event
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(rpc_event, client) ⇒ ConsoleMessage
constructor
A new instance of ConsoleMessage.
-
#level ⇒ Symbol
The documented values are :debug, :error, :log, :tip, and :warning.
-
#reason ⇒ Symbol
The documented values are :console_api, :html, :javascript, :network, :other, :wml, and :xml.
-
#text ⇒ String
The message text.
Methods inherited from WebkitRemote::Event
can_receive?, class_for, for, #matches?, register, register_class
Constructor Details
#initialize(rpc_event, client) ⇒ ConsoleMessage
Returns a new instance of ConsoleMessage.
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/webkit_remote/client/console_events.rb', line 33 def initialize(rpc_event, client) super if = raw_data['message'] @message = WebkitRemote::Client::ConsoleMessage.new raw_data['message'], client client. @message else @message = nil end end |
Instance Attribute Details
#message ⇒ WebkitRemote::Client::ConsoleMessage (readonly)
Returns the new message.
10 11 12 |
# File 'lib/webkit_remote/client/console_events.rb', line 10 def @message end |
Class Method Details
.can_reach?(client) ⇒ Boolean
46 47 48 |
# File 'lib/webkit_remote/client/console_events.rb', line 46 def self.can_reach?(client) client.console_events end |
Instance Method Details
#level ⇒ Symbol
The documented values are :debug, :error, :log, :tip, and :warning.
20 21 22 |
# File 'lib/webkit_remote/client/console_events.rb', line 20 def level @message.level end |
#reason ⇒ Symbol
The documented values are :console_api, :html, :javascript, :network,
:other, :wml, and :xml.
28 29 30 |
# File 'lib/webkit_remote/client/console_events.rb', line 28 def reason @message.reason end |
#text ⇒ String
Returns the message text.
13 14 15 |
# File 'lib/webkit_remote/client/console_events.rb', line 13 def text @message.text end |