Class: Playwright::HttpHeaders
- Inherits:
-
Object
- Object
- Playwright::HttpHeaders
- Defined in:
- lib/playwright/http_headers.rb
Class Method Summary collapse
Instance Method Summary collapse
- #as_serialized ⇒ Object
-
#initialize(headers) ⇒ HttpHeaders
constructor
A new instance of HttpHeaders.
Constructor Details
#initialize(headers) ⇒ HttpHeaders
Returns a new instance of HttpHeaders.
4 5 6 |
# File 'lib/playwright/http_headers.rb', line 4 def initialize(headers) @headers = headers end |
Class Method Details
.parse_serialized(serialized_headers) ⇒ Object
14 15 16 17 18 |
# File 'lib/playwright/http_headers.rb', line 14 def self.parse_serialized(serialized_headers) new(serialized_headers.map do |header| [header['name'].downcase, header['value']] end.to_h) end |
Instance Method Details
#as_serialized ⇒ Object
8 9 10 11 12 |
# File 'lib/playwright/http_headers.rb', line 8 def as_serialized @headers.map do |key, value| { name: key, value: value } end end |