Class: Selenium::WebDriver::Remote::Response Private

Inherits:
Object
  • Object
show all
Defined in:
rb/lib/selenium/webdriver/remote/response.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, payload = nil) ⇒ Response

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Response.



30
31
32
33
34
35
# File 'rb/lib/selenium/webdriver/remote/response.rb', line 30

def initialize(code, payload = nil)
  @code = code
  @payload = payload || {}

  assert_ok
end

Instance Attribute Details

#codeObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
# File 'rb/lib/selenium/webdriver/remote/response.rb', line 28

def code
  @code
end

#payloadObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



28
29
30
# File 'rb/lib/selenium/webdriver/remote/response.rb', line 28

def payload
  @payload
end

Instance Method Details

#[](key) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



45
46
47
# File 'rb/lib/selenium/webdriver/remote/response.rb', line 45

def [](key)
  @payload[key]
end

#errorObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



37
38
39
40
41
42
43
# File 'rb/lib/selenium/webdriver/remote/response.rb', line 37

def error
  error, message, backtrace = process_error
  klass = Error.for_error(error) || return
  ex = klass.new(message)
  add_cause(ex, error, backtrace)
  ex
end