Class: NxtHttpClient::Config

Inherits:
Struct
  • Object
show all
Defined in:
lib/nxt_http_client/config.rb

Instance Method Summary collapse

Constructor Details

#initializeConfig

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

#dupObject



34
35
36
37
38
39
40
41
# File 'lib/nxt_http_client/config.rb', line 34

def dup
  options = to_h
  self.class.new.tap do |instance|
    options.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