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.
3 4 5 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 3 def initialize(data) @data = data end |
Instance Method Details
#body_size ⇒ Object
27 28 29 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 27 def body_size @data['bodySize'] end |
#content_type ⇒ Object
31 32 33 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 31 def content_type @data['contentType'] end |
#headers ⇒ Object
19 20 21 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 19 def headers @data['headers'] end |
#redirect_url ⇒ Object
23 24 25 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 23 def redirect_url @data['redirectURL'] end |
#status ⇒ Object
11 12 13 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 11 def status @data['status'] end |
#status_text ⇒ Object
15 16 17 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 15 def status_text @data['statusText'] end |
#time ⇒ Object
35 36 37 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 35 def time @data['time'] && Time.parse(@data['time']) end |
#url ⇒ Object
7 8 9 |
# File 'lib/capybara/poltergeist/network_traffic/response.rb', line 7 def url @data['url'] end |