123456789_123456789_123456789_123456789_123456789_

Class: Selenium::WebDriver::DevTools::Request

Relationships & Source Files
Inherits: Object
Defined in: rb/lib/selenium/webdriver/devtools/request.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(id:, url:, method:, headers:, post_data:) ⇒ Request

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 42

def initialize(id:, url:, method:, headers:, post_data:)
  @id = id
  @url = url
  @method = method
  @headers = headers
  @post_data = post_data
end

Class Method Details

.from(id, params)

This method is for internal use only.

Creates request from ::Selenium::WebDriver::DevTools message.

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 32

def self.from(id, params)
  new(
    id: id,
    url: params.dig('request', 'url'),
    method: params.dig('request', 'method'),
    headers: params.dig('request', 'headers').dup,
    post_data: params.dig('request', 'postData')
  )
end

Instance Attribute Details

#headers (rw)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 24

attr_accessor :url, :method, :headers, :post_data

#id (readonly)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 25

attr_reader :id

#method (rw)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 24

attr_accessor :url, :method, :headers, :post_data

#post_data (rw)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 24

attr_accessor :url, :method, :headers, :post_data

#url (rw)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 24

attr_accessor :url, :method, :headers, :post_data

Instance Method Details

#==(other)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 50

def ==(other)
  self.class == other.class &&
    id == other.id &&
    url == other.url &&
    method == other.method &&
    headers == other.headers &&
    post_data == other.post_data
end

#inspect

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 59

def inspect
  %(#<#{self.class.name} @id="#{id}" @method="#{method}" @url="#{url}")
end