Class: WebkitRemote::Event::NetworkCacheHit

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

Overview

Emitted when a resource is served from the local cache.

Instance Attribute Summary collapse

Attributes inherited from WebkitRemote::Event

#domain, #name, #raw_data

Instance Method Summary collapse

Methods inherited from WebkitRemote::Event

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

Constructor Details

#initialize(rpc_event, client) ⇒ NetworkCacheHit

Returns a new instance of NetworkCacheHit.



99
100
101
102
103
104
# File 'lib/webkit_remote/client/network_events.rb', line 99

def initialize(rpc_event, client)
  super

  @resource = client.network_resource raw_data['requestId']
  @resource.add_event self
end

Instance Attribute Details

#resourceWebkitRemote::Client::NetworkResource (readonly)

Returns information about the resource fetched by this network operation.

Returns:



96
97
98
# File 'lib/webkit_remote/client/network_events.rb', line 96

def resource
  @resource
end