Class: ScreenshotScout::TransportRequest
- Inherits:
-
Object
- Object
- ScreenshotScout::TransportRequest
- Defined in:
- lib/screenshotscout/transport.rb,
sig/screenshotscout.rbs
Overview
The request object passed to an injected transport's #call method.
Instance Attribute Summary collapse
-
#body ⇒ String?
readonly
Returns the value of attribute body.
-
#headers ⇒ Hash[String, String]
readonly
Returns the value of attribute headers.
-
#method ⇒ capture_http_method
readonly
Returns the value of attribute method.
-
#url ⇒ String
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(method:, url:, headers:, body: nil) ⇒ TransportRequest
constructor
A new instance of TransportRequest.
Constructor Details
#initialize(method:, url:, headers:, body: nil) ⇒ TransportRequest
Returns a new instance of TransportRequest.
11 12 13 14 15 16 17 18 19 |
# File 'lib/screenshotscout/transport.rb', line 11 def initialize(method:, url:, headers:, body: nil) @method = method.dup.freeze @url = url.dup.freeze @headers = headers.to_h do |name, value| [name.to_s.dup.freeze, value.to_s.dup.freeze] end.freeze @body = body&.dup&.freeze freeze end |
Instance Attribute Details
#body ⇒ String? (readonly)
Returns the value of attribute body.
9 10 11 |
# File 'lib/screenshotscout/transport.rb', line 9 def body @body end |
#headers ⇒ Hash[String, String] (readonly)
Returns the value of attribute headers.
9 10 11 |
# File 'lib/screenshotscout/transport.rb', line 9 def headers @headers end |
#method ⇒ capture_http_method (readonly)
Returns the value of attribute method.
9 10 11 |
# File 'lib/screenshotscout/transport.rb', line 9 def method @method end |
#url ⇒ String (readonly)
Returns the value of attribute url.
9 10 11 |
# File 'lib/screenshotscout/transport.rb', line 9 def url @url end |