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.
19 20 21 22 23 |
# File 'lib/nxt_http_client/config.rb', line 19 def initialize CONFIGURABLE_OPTIONS.each do |key, default_value| self.send(:"#{key}=", default_value.dup) end end |
Instance Method Details
#dup ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/nxt_http_client/config.rb', line 31 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
25 26 27 28 29 |
# File 'lib/nxt_http_client/config.rb', line 25 def timeout_seconds(total:, connect: nil) timeouts = { total:, connect:, }.compact self.timeouts = timeouts end |