Class: WebkitRemote::Event::ConsoleMessageRepeated

Inherits:
WebkitRemote::Event show all
Defined in:
lib/webkit_remote/client/console_events.rb

Overview

Emitted when the same console message is produced repeatedly.

Instance Attribute Summary collapse

Attributes inherited from WebkitRemote::Event

#domain, #name, #raw_data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from WebkitRemote::Event

can_receive?, class_for, for, #matches?, register, register_class

Constructor Details

#initialize(rpc_event, client) ⇒ ConsoleMessageRepeated

Returns a new instance of ConsoleMessageRepeated.



62
63
64
65
66
67
68
# File 'lib/webkit_remote/client/console_events.rb', line 62

def initialize(rpc_event, client)
  super

  @message = client.console_messages.last
  @count = raw_data['count'] ? raw_data['count'].to_i : nil
  @message.count = @count if @count
end

Instance Attribute Details

#countNumber (readonly)

Returns the number of times that the message was repeated.

Returns:

  • (Number)

    the number of times that the message was repeated



59
60
61
# File 'lib/webkit_remote/client/console_events.rb', line 59

def count
  @count
end

#messageWebkitRemote::Client::ConsoleMessage (readonly)

Returns the repeated message.

Returns:



56
57
58
# File 'lib/webkit_remote/client/console_events.rb', line 56

def message
  @message
end

Class Method Details

.can_reach?(client) ⇒ Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/webkit_remote/client/console_events.rb', line 71

def self.can_reach?(client)
  client.console_events
end