class Capybara::Apparition::NetworkTraffic::Response

Public Class Methods

new(data) click to toggle source
# File lib/capybara/apparition/network_traffic/response.rb, line 5
def initialize(data)
  @data = data
end

Public Instance Methods

body_size() click to toggle source
# File lib/capybara/apparition/network_traffic/response.rb, line 29
def body_size
  @data['bodySize']
end
content_type() click to toggle source
# File lib/capybara/apparition/network_traffic/response.rb, line 33
def content_type
  @data['contentType']
end
error() click to toggle source
# File lib/capybara/apparition/network_traffic/response.rb, line 45
def error
  Error.new(url: url, code: status, description: status_text)
end
from_cache?() click to toggle source
# File lib/capybara/apparition/network_traffic/response.rb, line 37
def from_cache?
  @data['fromDiskCache'] == true
end
headers() click to toggle source
# File lib/capybara/apparition/network_traffic/response.rb, line 21
def headers
  @data['headers']
end
redirect_url() click to toggle source
# File lib/capybara/apparition/network_traffic/response.rb, line 25
def redirect_url
  @data['redirectURL']
end
status() click to toggle source
# File lib/capybara/apparition/network_traffic/response.rb, line 13
def status
  @data['status']
end
status_text() click to toggle source
# File lib/capybara/apparition/network_traffic/response.rb, line 17
def status_text
  @data['statusText']
end
time() click to toggle source
# File lib/capybara/apparition/network_traffic/response.rb, line 41
def time
  @data['timestamp'] && Time.parse(@data['timestamp'])
end
url() click to toggle source
# File lib/capybara/apparition/network_traffic/response.rb, line 9
def url
  @data['url']
end