Class: Capybara::Poltergeist::NetworkTraffic::Response
- Inherits:
-
Object
- Object
- Capybara::Poltergeist::NetworkTraffic::Response
- Defined in:
- lib/capybara/poltergeist/network_traffic/response.rb
Instance Method Summary collapse
- #body_size ⇒ Object
- #content_type ⇒ Object
- #headers ⇒ Object
-
#initialize(data) ⇒ Response
constructor
A new instance of Response.
- #redirect_url ⇒ Object
- #status ⇒ Object
- #status_text ⇒ Object
- #time ⇒ Object
- #url ⇒ Object
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_size ⇒ Object
29 30 31 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 29 def body_size @data['bodySize'] end |
#content_type ⇒ Object
33 34 35 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 33 def content_type @data['contentType'] end |
#headers ⇒ Object
21 22 23 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 21 def headers @data['headers'] end |
#redirect_url ⇒ Object
25 26 27 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 25 def redirect_url @data['redirectURL'] end |
#status ⇒ Object
13 14 15 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 13 def status @data['status'] end |
#status_text ⇒ Object
17 18 19 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 17 def status_text @data['statusText'] end |
#time ⇒ Object
37 38 39 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 37 def time @data['time'] && Time.parse(@data['time']) end |
#url ⇒ Object
9 10 11 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 9 def url @data['url'] end |