Class: WebkitRemote::Client::NetworkRequestInitiator
- Inherits:
-
Object
- Object
- WebkitRemote::Client::NetworkRequestInitiator
- Defined in:
- lib/webkit_remote/client/network_events.rb
Overview
Wraps information about the reason behind a network request.
Instance Attribute Summary collapse
-
#line ⇒ Number
readonly
Number of the line that references the requested resource.
-
#stack_trace ⇒ WebkitRemote::Console
readonly
WebkitRemote::Console.
-
#type ⇒ Symbol
readonly
Reason behind the request; documented values are :parser, :script and :other.
-
#url ⇒ String
readonly
URL of the document that references the requested resource.
Instance Method Summary collapse
-
#initialize(raw_initiator) ⇒ NetworkRequestInitiator
constructor
A new instance of NetworkRequestInitiator.
Constructor Details
#initialize(raw_initiator) ⇒ NetworkRequestInitiator
Returns a new instance of NetworkRequestInitiator.
516 517 518 519 520 521 522 523 524 525 526 |
# File 'lib/webkit_remote/client/network_events.rb', line 516 def initialize(raw_initiator) if raw_initiator['lineNumber'] @line = raw_initiator['lineNumber'].to_i else @line = nil end @stack_trace = WebkitRemote::Client::ConsoleMessage.parse_stack_trace( raw_initiator['stackTrace']) @type = (raw_initiator['type'] || 'other').to_sym @url = raw_initiator['url'] end |
Instance Attribute Details
#line ⇒ Number (readonly)
Returns number of the line that references the requested resource.
510 511 512 |
# File 'lib/webkit_remote/client/network_events.rb', line 510 def line @line end |
#stack_trace ⇒ WebkitRemote::Console (readonly)
Returns WebkitRemote::Console.
513 514 515 |
# File 'lib/webkit_remote/client/network_events.rb', line 513 def stack_trace @stack_trace end |
#type ⇒ Symbol (readonly)
Returns reason behind the request; documented values are :parser, :script and :other.
504 505 506 |
# File 'lib/webkit_remote/client/network_events.rb', line 504 def type @type end |
#url ⇒ String (readonly)
Returns URL of the document that references the requested resource.
507 508 509 |
# File 'lib/webkit_remote/client/network_events.rb', line 507 def url @url end |