Class: Selenium::WebDriver::Remote::Response
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Remote::Response
- Defined in:
- lib/selenium/webdriver/remote/response.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#payload ⇒ Object
Returns the value of attribute payload.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #error ⇒ Object
- #error_message ⇒ Object
-
#initialize(code, payload = nil) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(code, payload = nil) ⇒ Response
Returns a new instance of Response.
11 12 13 14 15 16 |
# File 'lib/selenium/webdriver/remote/response.rb', line 11 def initialize(code, payload = nil) @code = code @payload = payload || {} assert_ok end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
8 9 10 |
# File 'lib/selenium/webdriver/remote/response.rb', line 8 def code @code end |
#payload ⇒ Object
Returns the value of attribute payload.
8 9 10 |
# File 'lib/selenium/webdriver/remote/response.rb', line 8 def payload @payload end |
Instance Method Details
#[](key) ⇒ Object
26 27 28 |
# File 'lib/selenium/webdriver/remote/response.rb', line 26 def [](key) @payload[key] end |
#error ⇒ Object
18 19 20 |
# File 'lib/selenium/webdriver/remote/response.rb', line 18 def error Error.for_code @payload['status'] end |
#error_message ⇒ Object
22 23 24 |
# File 'lib/selenium/webdriver/remote/response.rb', line 22 def @payload['value']['message'] end |