Class: NxtHttpClient::Config
- Inherits:
-
Struct
- Object
- Struct
- NxtHttpClient::Config
- Defined in:
- lib/nxt_http_client/config.rb
Instance Method Summary collapse
- #dup ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #timeout_seconds(total:, connect: nil) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
22 23 24 25 26 |
# File 'lib/nxt_http_client/config.rb', line 22 def initialize CONFIGURABLE_OPTIONS.each do |key, default_value| self.send(:"#{key}=", default_value.dup) end end |
Instance Method Details
#dup ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/nxt_http_client/config.rb', line 34 def dup = to_h self.class.new.tap do |instance| .each do |key, value| instance.send(:"#{key}=", value.dup) end end end |
#timeout_seconds(total:, connect: nil) ⇒ Object
28 29 30 31 32 |
# File 'lib/nxt_http_client/config.rb', line 28 def timeout_seconds(total:, connect: nil) timeouts = { total:, connect:, }.compact self.timeouts = timeouts end |