Class: Selenium::WebDriver::DevTools::Response
Relationships & Source Files | |
Inherits: | Object |
Defined in: | rb/lib/selenium/webdriver/devtools/response.rb |
Class Method Summary
- .new(id:, code:, body:, headers:) ⇒ Response constructor
-
.from(id, encoded_body, params)
Internal use only
Internal use only
Creates response from
::Selenium::WebDriver::DevTools
message.
Instance Attribute Summary
Instance Method Summary
Constructor Details
.new(id:, code:, body:, headers:) ⇒ Response
Class Method Details
.from(id, encoded_body, params)
This method is for internal use only.
Creates response from ::Selenium::WebDriver::DevTools
message.
# File 'rb/lib/selenium/webdriver/devtools/response.rb', line 32
def self.from(id, encoded_body, params) new( id: id, code: params['responseStatusCode'], body: (Base64.strict_decode64(encoded_body) if encoded_body), headers: params.fetch('responseHeaders', []).each_with_object({}) do |header, hash| hash[header['name']] = header['value'] end ) end
Instance Attribute Details
#body (rw)
[ GitHub ]#code (rw)
[ GitHub ]#headers (rw)
[ GitHub ]#id (readonly)
[ GitHub ]# File 'rb/lib/selenium/webdriver/devtools/response.rb', line 25
attr_reader :id