nexmo 6.0.1 → 7.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +24 -4
- data/lib/nexmo.rb +12 -14
- data/lib/nexmo/abstract_authentication.rb +2 -0
- data/lib/nexmo/account.rb +6 -1
- data/lib/nexmo/alerts.rb +6 -1
- data/lib/nexmo/applications.rb +24 -3
- data/lib/nexmo/applications/list_response.rb +2 -0
- data/lib/nexmo/authentication_error.rb +2 -0
- data/lib/nexmo/basic.rb +2 -0
- data/lib/nexmo/bearer_token.rb +1 -0
- data/lib/nexmo/client.rb +46 -23
- data/lib/nexmo/client_error.rb +2 -0
- data/lib/nexmo/config.rb +52 -9
- data/lib/nexmo/conversations.rb +24 -0
- data/lib/nexmo/conversations/events.rb +1 -0
- data/lib/nexmo/conversations/legs.rb +1 -0
- data/lib/nexmo/conversations/members.rb +1 -0
- data/lib/nexmo/conversations/users.rb +1 -0
- data/lib/nexmo/conversions.rb +4 -0
- data/lib/nexmo/entity.rb +5 -3
- data/lib/nexmo/error.rb +2 -0
- data/lib/nexmo/errors.rb +10 -0
- data/lib/nexmo/files.rb +7 -2
- data/lib/nexmo/form_data.rb +2 -0
- data/lib/nexmo/gsm7.rb +2 -0
- data/lib/nexmo/http.rb +12 -3
- data/lib/nexmo/json.rb +4 -0
- data/lib/nexmo/jwt.rb +6 -2
- data/lib/nexmo/key_secret_params.rb +10 -2
- data/lib/nexmo/keys.rb +7 -1
- data/lib/nexmo/logger.rb +14 -4
- data/lib/nexmo/messages.rb +7 -1
- data/lib/nexmo/namespace.rb +15 -18
- data/lib/nexmo/number_insight.rb +21 -6
- data/lib/nexmo/numbers.rb +24 -20
- data/lib/nexmo/numbers/list_response.rb +2 -0
- data/lib/nexmo/numbers/response.rb +1 -0
- data/lib/nexmo/params.rb +1 -0
- data/lib/nexmo/pricing.rb +2 -1
- data/lib/nexmo/pricing_types.rb +1 -0
- data/lib/nexmo/redact.rb +2 -1
- data/lib/nexmo/response.rb +2 -0
- data/lib/nexmo/secrets.rb +1 -0
- data/lib/nexmo/secrets/list_response.rb +2 -0
- data/lib/nexmo/server_error.rb +2 -0
- data/lib/nexmo/signature.rb +19 -13
- data/lib/nexmo/sms.rb +16 -10
- data/lib/nexmo/tfa.rb +2 -1
- data/lib/nexmo/user_agent.rb +1 -0
- data/lib/nexmo/verify.rb +93 -17
- data/lib/nexmo/version.rb +3 -1
- data/lib/nexmo/{calls.rb → voice.rb} +12 -11
- data/lib/nexmo/{calls → voice}/dtmf.rb +2 -1
- data/lib/nexmo/{calls → voice}/list_response.rb +3 -1
- data/lib/nexmo/{calls → voice}/stream.rb +2 -1
- data/lib/nexmo/{calls → voice}/talk.rb +2 -1
- data/nexmo.gemspec +2 -7
- metadata +17 -85
- data/lib/nexmo/key_secret_query.rb +0 -20
- data/lib/nexmo/number_insight/response.rb +0 -5
- data/lib/nexmo/sms/response.rb +0 -7
- data/lib/nexmo/verify/response.rb +0 -5
data/lib/nexmo/client_error.rb
CHANGED
data/lib/nexmo/config.rb
CHANGED
@@ -1,22 +1,30 @@
|
|
1
|
+
# typed: true
|
1
2
|
# frozen_string_literal: true
|
2
3
|
require 'logger'
|
3
4
|
|
4
5
|
module Nexmo
|
5
6
|
class Config
|
7
|
+
extend T::Sig
|
8
|
+
|
9
|
+
sig { void }
|
6
10
|
def initialize
|
7
|
-
self.
|
8
|
-
self.
|
9
|
-
self.
|
10
|
-
self.
|
11
|
-
self.
|
11
|
+
self.api_host = 'api.nexmo.com'
|
12
|
+
self.api_key = T.let(ENV['NEXMO_API_KEY'], T.nilable(String))
|
13
|
+
self.api_secret = T.let(ENV['NEXMO_API_SECRET'], T.nilable(String))
|
14
|
+
self.application_id = ENV['NEXMO_APPLICATION_ID']
|
15
|
+
self.logger = (defined?(Rails.logger) && Rails.log) || Nexmo::Logger.new(nil)
|
16
|
+
self.private_key = ENV['NEXMO_PRIVATE_KEY_PATH'] ? File.read(T.must(ENV['NEXMO_PRIVATE_KEY_PATH'])) : ENV['NEXMO_PRIVATE_KEY']
|
17
|
+
self.rest_host = 'rest.nexmo.com'
|
12
18
|
self.signature_secret = ENV['NEXMO_SIGNATURE_SECRET']
|
13
|
-
self.
|
19
|
+
self.signature_method = ENV['NEXMO_SIGNATURE_METHOD'] || 'md5hash'
|
20
|
+
self.token = T.let(nil, T.nilable(String))
|
14
21
|
end
|
15
22
|
|
16
23
|
# Merges the config with the given options hash.
|
17
24
|
#
|
18
25
|
# @return [Nexmo::Config]
|
19
26
|
#
|
27
|
+
sig { params(options: T.nilable(T::Hash[Symbol, T.untyped])).returns(Nexmo::Config) }
|
20
28
|
def merge(options)
|
21
29
|
return self if options.nil? || options.empty?
|
22
30
|
|
@@ -25,13 +33,18 @@ module Nexmo
|
|
25
33
|
end
|
26
34
|
end
|
27
35
|
|
36
|
+
sig { returns(String) }
|
37
|
+
attr_accessor :api_host
|
38
|
+
|
28
39
|
# Returns the value of attribute api_key.
|
29
40
|
#
|
30
41
|
# @return [String]
|
31
42
|
#
|
32
43
|
# @raise [AuthenticationError]
|
33
44
|
#
|
45
|
+
sig { returns(T.nilable(String)) }
|
34
46
|
def api_key
|
47
|
+
@api_key = T.let(@api_key, T.nilable(String))
|
35
48
|
unless @api_key
|
36
49
|
raise AuthenticationError.new('No API key provided. ' \
|
37
50
|
'See https://developer.nexmo.com/concepts/guides/authentication for details, ' \
|
@@ -41,6 +54,7 @@ module Nexmo
|
|
41
54
|
@api_key
|
42
55
|
end
|
43
56
|
|
57
|
+
sig { params(api_key: T.nilable(String)).returns(T.nilable(String)) }
|
44
58
|
attr_writer :api_key
|
45
59
|
|
46
60
|
# Returns the value of attribute api_secret.
|
@@ -49,7 +63,9 @@ module Nexmo
|
|
49
63
|
#
|
50
64
|
# @raise [AuthenticationError]
|
51
65
|
#
|
66
|
+
sig { returns(T.nilable(String)) }
|
52
67
|
def api_secret
|
68
|
+
@api_secret = T.let(@api_secret, T.nilable(String))
|
53
69
|
unless @api_secret
|
54
70
|
raise AuthenticationError.new('No API secret provided. ' \
|
55
71
|
'See https://developer.nexmo.com/concepts/guides/authentication for details, ' \
|
@@ -59,6 +75,7 @@ module Nexmo
|
|
59
75
|
@api_secret
|
60
76
|
end
|
61
77
|
|
78
|
+
sig { params(api_secret: T.nilable(String)).returns(T.nilable(String)) }
|
62
79
|
attr_writer :api_secret
|
63
80
|
|
64
81
|
# Returns the value of attribute application_id.
|
@@ -67,7 +84,9 @@ module Nexmo
|
|
67
84
|
#
|
68
85
|
# @raise [AuthenticationError]
|
69
86
|
#
|
87
|
+
sig { returns(T.nilable(String)) }
|
70
88
|
def application_id
|
89
|
+
@application_id = T.let(@application_id, T.nilable(String))
|
71
90
|
unless @application_id
|
72
91
|
raise AuthenticationError.new('No application_id provided. ' \
|
73
92
|
'Either provide an application_id, or set an auth token. ' \
|
@@ -79,32 +98,40 @@ module Nexmo
|
|
79
98
|
@application_id
|
80
99
|
end
|
81
100
|
|
101
|
+
sig { params(application_id: T.nilable(String)).returns(T.nilable(String)) }
|
82
102
|
attr_writer :application_id
|
83
103
|
|
104
|
+
sig { returns(T.nilable(String)) }
|
84
105
|
attr_accessor :app_name
|
85
106
|
|
107
|
+
sig { returns(T.nilable(String)) }
|
86
108
|
attr_accessor :app_version
|
87
109
|
|
88
110
|
# Returns the value of attribute http.
|
89
111
|
#
|
90
112
|
# @return [Nexmo::HTTP::Options]
|
91
113
|
#
|
114
|
+
sig { returns(T.nilable(Nexmo::HTTP::Options)) }
|
92
115
|
attr_reader :http
|
93
116
|
|
117
|
+
sig { params(hash: T::Hash[T.untyped, T.untyped]).returns(T.nilable(Nexmo::HTTP::Options)) }
|
94
118
|
def http=(hash)
|
95
|
-
@http = HTTP::Options
|
119
|
+
@http = T.let(nil, T.nilable(Nexmo::HTTP::Options))
|
120
|
+
@http = Nexmo::HTTP::Options.new(hash)
|
96
121
|
end
|
97
122
|
|
98
123
|
# Returns the value of attribute logger.
|
99
124
|
#
|
100
125
|
# @return [Nexmo::Logger]
|
101
126
|
#
|
127
|
+
sig { returns(T.nilable(Nexmo::Logger)) }
|
102
128
|
attr_reader :logger
|
103
129
|
|
104
130
|
# @return [Nexmo::Logger]
|
105
131
|
#
|
132
|
+
sig { params(logger: T.nilable(T.any(::Logger, Nexmo::Logger))).returns(T.nilable(Nexmo::Logger)) }
|
106
133
|
def logger=(logger)
|
107
|
-
@logger = Logger.new(logger)
|
134
|
+
@logger = T.let(Logger.new(logger), T.nilable(Nexmo::Logger))
|
108
135
|
end
|
109
136
|
|
110
137
|
# Returns the value of attribute private_key.
|
@@ -113,7 +140,9 @@ module Nexmo
|
|
113
140
|
#
|
114
141
|
# @raise [AuthenticationError]
|
115
142
|
#
|
143
|
+
sig { returns(T.nilable(String)) }
|
116
144
|
def private_key
|
145
|
+
@private_key = T.let(@private_key, T.nilable(String))
|
117
146
|
unless @private_key
|
118
147
|
raise AuthenticationError.new('No private_key provided. ' \
|
119
148
|
'Either provide a private_key, or set an auth token. ' \
|
@@ -125,15 +154,21 @@ module Nexmo
|
|
125
154
|
@private_key
|
126
155
|
end
|
127
156
|
|
157
|
+
sig { params(private_key: T.nilable(String)).returns(T.nilable(String)) }
|
128
158
|
attr_writer :private_key
|
129
159
|
|
160
|
+
sig { returns(String) }
|
161
|
+
attr_accessor :rest_host
|
162
|
+
|
130
163
|
# Returns the value of attribute signature_secret.
|
131
164
|
#
|
132
165
|
# @return [String]
|
133
166
|
#
|
134
167
|
# @raise [AuthenticationError]
|
135
168
|
#
|
169
|
+
sig { returns(T.nilable(String)) }
|
136
170
|
def signature_secret
|
171
|
+
@signature_secret = T.let(@signature_secret, T.nilable(String))
|
137
172
|
unless @signature_secret
|
138
173
|
raise AuthenticationError.new('No signature_secret provided. ' \
|
139
174
|
'You can find your signature secret in the Nexmo dashboard. ' \
|
@@ -144,20 +179,28 @@ module Nexmo
|
|
144
179
|
@signature_secret
|
145
180
|
end
|
146
181
|
|
182
|
+
sig { params(signature_secret: T.nilable(String)).returns(T.nilable(String)) }
|
147
183
|
attr_writer :signature_secret
|
148
184
|
|
185
|
+
sig { returns(String) }
|
186
|
+
attr_accessor :signature_method
|
187
|
+
|
149
188
|
# Returns the value of attribute token, or a temporary short lived token.
|
150
189
|
#
|
151
190
|
# @return [String]
|
152
191
|
#
|
192
|
+
sig { returns(T.nilable(String)) }
|
153
193
|
def token
|
154
|
-
@token
|
194
|
+
@token = T.let(nil, T.nilable(String))
|
195
|
+
@token || JWT.generate({application_id: application_id}, T.must(private_key))
|
155
196
|
end
|
156
197
|
|
198
|
+
sig { params(token: T.nilable(String)).returns(T.nilable(String)) }
|
157
199
|
attr_writer :token
|
158
200
|
|
159
201
|
protected
|
160
202
|
|
203
|
+
sig { params(name: Symbol, value: T.nilable(T.untyped)).void }
|
161
204
|
def write_attribute(name, value)
|
162
205
|
public_send(:"#{name}=", value)
|
163
206
|
end
|
data/lib/nexmo/conversations.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
+
# typed: strict
|
1
2
|
# frozen_string_literal: true
|
2
3
|
|
3
4
|
module Nexmo
|
4
5
|
class Conversations < Namespace
|
6
|
+
extend T::Sig
|
7
|
+
|
5
8
|
self.authentication = BearerToken
|
6
9
|
|
7
10
|
self.request_body = JSON
|
@@ -32,6 +35,7 @@ module Nexmo
|
|
32
35
|
#
|
33
36
|
# @see https://developer.nexmo.com/api/conversation#createConversation
|
34
37
|
#
|
38
|
+
sig { params(params: T::Hash[Symbol, T.untyped]).returns(Nexmo::Response) }
|
35
39
|
def create(params)
|
36
40
|
request('/beta/conversations', params: params, type: Post)
|
37
41
|
end
|
@@ -62,6 +66,7 @@ module Nexmo
|
|
62
66
|
#
|
63
67
|
# @see https://developer.nexmo.com/api/conversation#replaceConversation
|
64
68
|
#
|
69
|
+
sig { params(params: T.nilable(T::Hash[Symbol, T.untyped])).returns(Nexmo::Response) }
|
65
70
|
def list(params = nil)
|
66
71
|
request('/beta/conversations', params: params)
|
67
72
|
end
|
@@ -77,6 +82,7 @@ module Nexmo
|
|
77
82
|
#
|
78
83
|
# @see https://developer.nexmo.com/api/conversation#retrieveConversation
|
79
84
|
#
|
85
|
+
sig { params(id: String).returns(Nexmo::Response) }
|
80
86
|
def get(id)
|
81
87
|
request('/beta/conversations/' + id)
|
82
88
|
end
|
@@ -109,6 +115,10 @@ module Nexmo
|
|
109
115
|
#
|
110
116
|
# @see https://developer.nexmo.com/api/conversation#replaceConversation
|
111
117
|
#
|
118
|
+
sig { params(
|
119
|
+
id: String,
|
120
|
+
params: T::Hash[Symbol, T.untyped]
|
121
|
+
).returns(Nexmo::Response) }
|
112
122
|
def update(id, params)
|
113
123
|
request('/beta/conversations/' + id, params: params, type: Put)
|
114
124
|
end
|
@@ -124,6 +134,7 @@ module Nexmo
|
|
124
134
|
#
|
125
135
|
# @see https://developer.nexmo.com/api/conversation#deleteConversation
|
126
136
|
#
|
137
|
+
sig { params(id: String).returns(Nexmo::Response) }
|
127
138
|
def delete(id)
|
128
139
|
request('/beta/conversations/' + id, type: Delete)
|
129
140
|
end
|
@@ -155,31 +166,44 @@ module Nexmo
|
|
155
166
|
#
|
156
167
|
# @see https://developer.nexmo.com/api/conversation#recordConversation
|
157
168
|
#
|
169
|
+
sig { params(
|
170
|
+
id: String,
|
171
|
+
params: T::Hash[Symbol, T.untyped]
|
172
|
+
).returns(Nexmo::Response) }
|
158
173
|
def record(id, params)
|
159
174
|
request('/v1/conversations/' + id + '/record', params: params, type: Put)
|
160
175
|
end
|
161
176
|
|
162
177
|
# @return [Events]
|
163
178
|
#
|
179
|
+
sig { returns(T.nilable(Nexmo::Conversations::Events)) }
|
164
180
|
def events
|
181
|
+
@events = T.let(@events, T.nilable(Nexmo::Conversations::Events))
|
182
|
+
@config = T.let(@config, T.nilable(Nexmo::Config))
|
165
183
|
@events ||= Events.new(@config)
|
166
184
|
end
|
167
185
|
|
168
186
|
# @return [Legs]
|
169
187
|
#
|
188
|
+
sig { returns(T.nilable(Nexmo::Conversations::Legs)) }
|
170
189
|
def legs
|
190
|
+
@legs = T.let(@legs, T.nilable(Nexmo::Conversations::Legs))
|
171
191
|
@legs ||= Legs.new(@config)
|
172
192
|
end
|
173
193
|
|
174
194
|
# @return [Members]
|
175
195
|
#
|
196
|
+
sig { returns(T.nilable(Nexmo::Conversations::Members)) }
|
176
197
|
def members
|
198
|
+
@members = T.let(@members, T.nilable(Nexmo::Conversations::Members))
|
177
199
|
@members ||= Members.new(@config)
|
178
200
|
end
|
179
201
|
|
180
202
|
# @return [Users]
|
181
203
|
#
|
204
|
+
sig { returns(T.nilable(Nexmo::Conversations::Users)) }
|
182
205
|
def users
|
206
|
+
@users = T.let(@users, T.nilable(Nexmo::Conversations::Users))
|
183
207
|
@users ||= Users.new(@config)
|
184
208
|
end
|
185
209
|
end
|
data/lib/nexmo/conversions.rb
CHANGED
@@ -1,13 +1,17 @@
|
|
1
|
+
# typed: strict
|
1
2
|
# frozen_string_literal: true
|
2
3
|
|
3
4
|
module Nexmo
|
4
5
|
class Conversions < Namespace
|
6
|
+
extend T::Sig
|
5
7
|
include Keys
|
6
8
|
|
9
|
+
sig { params(params: T::Hash[Symbol, T.untyped]).returns(Nexmo::Response) }
|
7
10
|
def track_sms(params)
|
8
11
|
request('/conversions/sms', params: hyphenate(params), type: Post)
|
9
12
|
end
|
10
13
|
|
14
|
+
sig { params(params: T::Hash[Symbol, T.untyped]).returns(Nexmo::Response) }
|
11
15
|
def track_voice(params)
|
12
16
|
request('/conversions/voice', params: hyphenate(params), type: Post)
|
13
17
|
end
|
data/lib/nexmo/entity.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
1
3
|
module Nexmo
|
2
4
|
class Entity
|
3
5
|
include Keys
|
4
6
|
|
5
|
-
def initialize(
|
6
|
-
@attributes =
|
7
|
+
def initialize(attributes = nil)
|
8
|
+
@attributes = attributes || {}
|
7
9
|
end
|
8
10
|
|
9
11
|
def [](key)
|
@@ -46,4 +48,4 @@ module Nexmo
|
|
46
48
|
|
47
49
|
include Enumerable
|
48
50
|
end
|
49
|
-
end
|
51
|
+
end
|
data/lib/nexmo/error.rb
CHANGED
data/lib/nexmo/errors.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
+
# typed: strict
|
1
2
|
# frozen_string_literal: true
|
2
3
|
require 'json'
|
3
4
|
|
4
5
|
module Nexmo
|
5
6
|
module Errors
|
7
|
+
extend T::Sig
|
8
|
+
|
9
|
+
sig {params(response: T.any(Net::HTTPUnauthorized, Net::HTTPClientError, Net::HTTPServerError, T.untyped)).returns(Nexmo::Error)}
|
6
10
|
def self.parse(response)
|
7
11
|
exception_class = case response
|
8
12
|
when Net::HTTPUnauthorized
|
@@ -20,6 +24,10 @@ module Nexmo
|
|
20
24
|
|
21
25
|
if hash.key?('error_title')
|
22
26
|
hash['error_title']
|
27
|
+
elsif hash.key?('error-code-label')
|
28
|
+
hash['error-code-label']
|
29
|
+
elsif hash.key?('description')
|
30
|
+
hash['description']
|
23
31
|
elsif problem_details?(hash)
|
24
32
|
problem_details_message(hash)
|
25
33
|
end
|
@@ -28,10 +36,12 @@ module Nexmo
|
|
28
36
|
exception_class.new(message)
|
29
37
|
end
|
30
38
|
|
39
|
+
sig { params(hash: T::Hash[String, T.untyped]).returns(T::Boolean) }
|
31
40
|
def self.problem_details?(hash)
|
32
41
|
hash.key?('title') && hash.key?('detail') && hash.key?('type')
|
33
42
|
end
|
34
43
|
|
44
|
+
sig { params(hash: T::Hash[String, T.untyped]).returns(String) }
|
35
45
|
def self.problem_details_message(hash)
|
36
46
|
"#{hash['title']}. #{hash['detail']} See #{hash['type']} for more info, or email support@nexmo.com if you have any questions."
|
37
47
|
end
|
data/lib/nexmo/files.rb
CHANGED
@@ -1,15 +1,20 @@
|
|
1
|
+
# typed: strict
|
1
2
|
# frozen_string_literal: true
|
2
3
|
|
3
4
|
module Nexmo
|
4
5
|
class Files < Namespace
|
6
|
+
extend T::Sig
|
7
|
+
|
5
8
|
self.authentication = BearerToken
|
6
9
|
|
10
|
+
sig { params(id: String).returns(T.nilable(Nexmo::Response)) }
|
7
11
|
def get(id)
|
8
|
-
request('/v1/files/' + id.split('/').last)
|
12
|
+
request('/v1/files/' + T.must(id.split('/').last))
|
9
13
|
end
|
10
14
|
|
15
|
+
sig { params(id: String, filename: String).returns(T.nilable(Nexmo::Response)) }
|
11
16
|
def save(id, filename)
|
12
|
-
request('/v1/files/' + id.split('/').last) do |response|
|
17
|
+
request('/v1/files/' + T.must(id.split('/').last)) do |response|
|
13
18
|
File.open(filename, 'wb') do |file|
|
14
19
|
response.read_body do |chunk|
|
15
20
|
file.write(chunk)
|
data/lib/nexmo/form_data.rb
CHANGED
data/lib/nexmo/gsm7.rb
CHANGED
data/lib/nexmo/http.rb
CHANGED
@@ -1,11 +1,18 @@
|
|
1
|
+
# typed: strict
|
1
2
|
# frozen_string_literal: true
|
2
3
|
require 'net/http'
|
3
4
|
|
4
5
|
module Nexmo
|
5
6
|
module HTTP
|
6
7
|
class Options
|
8
|
+
extend T::Sig
|
9
|
+
|
10
|
+
sig { params(hash: T::Hash[Symbol, T.untyped]).void }
|
7
11
|
def initialize(hash)
|
8
|
-
|
12
|
+
raise ArgumentError, 'hash parameter cannot be empty or nil' if hash == {} || hash.nil?
|
13
|
+
|
14
|
+
@hash = T.let(@hash, T::Hash[Symbol, T.untyped]) if defined? @hash
|
15
|
+
@hash = hash
|
9
16
|
|
10
17
|
@hash.each_key do |name|
|
11
18
|
next if defined_options.key?(name)
|
@@ -14,6 +21,7 @@ module Nexmo
|
|
14
21
|
end
|
15
22
|
end
|
16
23
|
|
24
|
+
sig { params(http: Net::HTTP).returns(T::Hash[Symbol, T.untyped]) }
|
17
25
|
def set(http)
|
18
26
|
@hash.each do |name, value|
|
19
27
|
http.public_send(defined_options.fetch(name), value)
|
@@ -22,13 +30,14 @@ module Nexmo
|
|
22
30
|
|
23
31
|
private
|
24
32
|
|
33
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
25
34
|
def defined_options
|
35
|
+
@defined_options = T.let(@defined_options, T.nilable(T::Hash[Symbol, T.untyped]))
|
36
|
+
|
26
37
|
@defined_options ||= Net::HTTP.instance_methods.grep(/\w=\z/).each_with_object({}) do |name, hash|
|
27
38
|
hash[name.to_s.chomp('=').to_sym] = name
|
28
39
|
end
|
29
40
|
end
|
30
41
|
end
|
31
42
|
end
|
32
|
-
|
33
|
-
private_constant :HTTP
|
34
43
|
end
|