Class: Selenium::WebDriver::DevTools::Request
- Inherits:
-
Object
- Object
- Selenium::WebDriver::DevTools::Request
- Defined in:
- rb/lib/selenium/webdriver/devtools/request.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#method ⇒ Object
Returns the value of attribute method.
-
#post_data ⇒ Object
Returns the value of attribute post_data.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
-
.from(id, params) ⇒ Object
private
Creates request from DevTools message.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(id:, url:, method:, headers:, post_data:) ⇒ Request
constructor
A new instance of Request.
- #inspect ⇒ Object
Constructor Details
#initialize(id:, url:, method:, headers:, post_data:) ⇒ Request
Returns a new instance of Request.
42 43 44 45 46 47 48 |
# 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 |
Instance Attribute Details
#headers ⇒ Object
Returns the value of attribute headers.
24 25 26 |
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 24 def headers @headers end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
25 26 27 |
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 25 def id @id end |
#method ⇒ Object
Returns the value of attribute method.
24 25 26 |
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 24 def method @method end |
#post_data ⇒ Object
Returns the value of attribute post_data.
24 25 26 |
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 24 def post_data @post_data end |
#url ⇒ Object
Returns the value of attribute url.
24 25 26 |
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 24 def url @url end |
Class Method Details
.from(id, params) ⇒ 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.
Creates request from DevTools message.
32 33 34 35 36 37 38 39 40 |
# 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 Method Details
#==(other) ⇒ Object
50 51 52 53 54 55 56 57 |
# 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 ⇒ Object
59 60 61 |
# File 'rb/lib/selenium/webdriver/devtools/request.rb', line 59 def inspect %(#<#{self.class.name} @id="#{id}" @method="#{method}" @url="#{url}") end |