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.



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

def initialize(data)
  @data = data
end

Instance Method Details

#body_sizeObject



27
28
29
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 27

def body_size
  @data['bodySize']
end

#content_typeObject



31
32
33
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 31

def content_type
  @data['contentType']
end

#headersObject



19
20
21
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 19

def headers
  @data['headers']
end

#redirect_urlObject



23
24
25
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 23

def redirect_url
  @data['redirectURL']
end

#statusObject



11
12
13
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 11

def status
  @data['status']
end

#status_textObject



15
16
17
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 15

def status_text
  @data['statusText']
end

#timeObject



35
36
37
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 35

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

#urlObject



7
8
9
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 7

def url
  @data['url']
end