Class: Capybara::Poltergeist::NetworkTraffic::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/poltergeist/network_traffic/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, response_parts = [], error = nil) ⇒ Request

Returns a new instance of Request.



7
8
9
10
11
# File 'lib/capybara/poltergeist/network_traffic/request.rb', line 7

def initialize(data, response_parts = [], error = nil)
  @data           = data
  @response_parts = response_parts
  @error = error
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



5
6
7
# File 'lib/capybara/poltergeist/network_traffic/request.rb', line 5

def error
  @error
end

#response_partsObject (readonly)

Returns the value of attribute response_parts.



5
6
7
# File 'lib/capybara/poltergeist/network_traffic/request.rb', line 5

def response_parts
  @response_parts
end

Instance Method Details

#headersObject



21
22
23
# File 'lib/capybara/poltergeist/network_traffic/request.rb', line 21

def headers
  @data['headers']
end

#methodObject



17
18
19
# File 'lib/capybara/poltergeist/network_traffic/request.rb', line 17

def method
  @data['method']
end

#timeObject



25
26
27
# File 'lib/capybara/poltergeist/network_traffic/request.rb', line 25

def time
  @data['time'] && Time.parse(@data['time'])
end

#urlObject



13
14
15
# File 'lib/capybara/poltergeist/network_traffic/request.rb', line 13

def url
  @data['url']
end