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 = []) ⇒ Request

Returns a new instance of Request.



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

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

Instance Attribute Details

#response_partsObject (readonly)

Returns the value of attribute response_parts.



3
4
5
# File 'lib/capybara/poltergeist/network_traffic/request.rb', line 3

def response_parts
  @response_parts
end

Instance Method Details

#headersObject



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

def headers
  @data['headers']
end

#methodObject



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

def method
  @data['method']
end

#timeObject



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

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

#urlObject



10
11
12
# File 'lib/capybara/poltergeist/network_traffic/request.rb', line 10

def url
  @data['url']
end