Class: Capybara::Poltergeist::NetworkTraffic::Response

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

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Response

Returns a new instance of Response.



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

def initialize(data)
  @data = data
end

Instance Method Details

#body_sizeObject



29
30
31
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 29

def body_size
  @data['bodySize']
end

#content_typeObject



33
34
35
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 33

def content_type
  @data['contentType']
end

#headersObject



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

def headers
  @data['headers']
end

#redirect_urlObject



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

def redirect_url
  @data['redirectURL']
end

#statusObject



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

def status
  @data['status']
end

#status_textObject



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

def status_text
  @data['statusText']
end

#timeObject



37
38
39
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 37

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

#urlObject



9
10
11
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 9

def url
  @data['url']
end