@@ -27,15 +27,12 @@ class AgentSettingsResolver
27
27
:deprecated_for_removal_transport_configuration_options
28
28
) do
29
29
def initialize (
30
- # Hacky required kw args, we can get rid of this when we drop Ruby 2.0
31
- ssl : raise ( ArgumentError , 'missing keyword :ssl' ) ,
32
- hostname : raise ( ArgumentError , 'missing keyword :hostname' ) ,
33
- port : raise ( ArgumentError , 'missing keyword :port' ) ,
34
- timeout_seconds : raise ( ArgumentError , 'missing keyword :timeout_seconds' ) ,
35
- deprecated_for_removal_transport_configuration_proc : \
36
- raise ( ArgumentError , 'missing keyword :deprecated_for_removal_transport_configuration_proc' ) ,
37
- deprecated_for_removal_transport_configuration_options : \
38
- raise ( ArgumentError , 'missing keyword :deprecated_for_removal_transport_configuration_options' )
30
+ ssl :,
31
+ hostname :,
32
+ port :,
33
+ timeout_seconds :,
34
+ deprecated_for_removal_transport_configuration_proc :,
35
+ deprecated_for_removal_transport_configuration_options :
39
36
)
40
37
super ( ssl , hostname , port , timeout_seconds , deprecated_for_removal_transport_configuration_proc , \
41
38
deprecated_for_removal_transport_configuration_options )
@@ -179,11 +176,7 @@ def unparsed_url_from_env
179
176
@unparsed_url_from_env ||= ENV [ Datadog ::Ext ::Transport ::HTTP ::ENV_DEFAULT_URL ]
180
177
end
181
178
182
- def pick_from (
183
- # Hacky required kw args, we can get rid of this when we drop Ruby 2.0
184
- configurations_in_priority_order : raise ( ArgumentError , 'missing keyword :configurations' ) ,
185
- or_use_default : raise ( ArgumentError , 'missing keyword :or_use_default' )
186
- )
179
+ def pick_from ( configurations_in_priority_order :, or_use_default :)
187
180
detected_configurations_in_priority_order = configurations_in_priority_order . select ( &:value? )
188
181
189
182
if detected_configurations_in_priority_order . any?
@@ -213,11 +206,7 @@ def log_warning(message)
213
206
end
214
207
215
208
DetectedConfiguration = Struct . new ( :friendly_name , :value ) do
216
- def initialize (
217
- # Hacky required kw args, we can get rid of this when we drop Ruby 2.0
218
- friendly_name : raise ( ArgumentError , 'missing keyword :friendly_name' ) ,
219
- value : raise ( ArgumentError , 'missing keyword :value' )
220
- )
209
+ def initialize ( friendly_name :, value :)
221
210
super ( friendly_name , value )
222
211
freeze
223
212
end
0 commit comments