Class: WebkitRemote::Client::NetworkCacheEntry
- Inherits:
-
Object
- Object
- WebkitRemote::Client::NetworkCacheEntry
- Defined in:
- lib/webkit_remote/client/network_events.rb
Overview
Wraps information about a resource served out of the browser’s cache.
Instance Attribute Summary collapse
-
#response ⇒ WebkitRemote::Client::NetworkResponse
readonly
The cached response data.
-
#type ⇒ Symbol
readonly
The type of resource returned by this response; documented values are :document, :font, :image, :other, :script, :stylesheet, :websocket and :xhr.
-
#url ⇒ String
readonly
The URL of the response.
Instance Method Summary collapse
-
#initialize(raw_cached_resource) ⇒ NetworkCacheEntry
constructor
A new instance of NetworkCacheEntry.
Constructor Details
#initialize(raw_cached_resource) ⇒ NetworkCacheEntry
Returns a new instance of NetworkCacheEntry.
539 540 541 542 543 544 545 546 547 548 |
# File 'lib/webkit_remote/client/network_events.rb', line 539 def initialize(raw_cached_resource) if raw_cached_resource['response'] @response = WebkitRemote::Client::NetworkResponse.new( raw_cached_resource['response']) else @response = nil end @type = (raw_cached_resource['type'] || 'other').downcase.to_sym @url = raw_cached_resource['url'] end |
Instance Attribute Details
#response ⇒ WebkitRemote::Client::NetworkResponse (readonly)
Returns the cached response data.
536 537 538 |
# File 'lib/webkit_remote/client/network_events.rb', line 536 def response @response end |
#type ⇒ Symbol (readonly)
Returns the type of resource returned by this response; documented values are :document, :font, :image, :other, :script, :stylesheet, :websocket and :xhr.
530 531 532 |
# File 'lib/webkit_remote/client/network_events.rb', line 530 def type @type end |
#url ⇒ String (readonly)
Returns the URL of the response.
533 534 535 |
# File 'lib/webkit_remote/client/network_events.rb', line 533 def url @url end |