iex-ruby-client 1.1.1 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.env.sample +2 -0
- data/.github/FUNDING.yml +1 -0
- data/.rubocop_todo.yml +0 -8
- data/CHANGELOG.md +49 -12
- data/Dangerfile +2 -2
- data/Gemfile +3 -2
- data/README.md +276 -20
- data/RELEASING.md +2 -2
- data/iex-ruby-client.gemspec +2 -1
- data/lib/iex/api.rb +8 -1
- data/lib/iex/api/client.rb +15 -2
- data/lib/iex/api/config/client.rb +52 -0
- data/lib/iex/api/config/logger.rb +35 -0
- data/lib/iex/cloud/connection.rb +22 -19
- data/lib/iex/cloud/response.rb +1 -1
- data/lib/iex/endpoints/advanced_stats.rb +11 -0
- data/lib/iex/endpoints/balance_sheet.rb +13 -0
- data/lib/iex/endpoints/cash_flow.rb +13 -0
- data/lib/iex/endpoints/historial_prices.rb +30 -0
- data/lib/iex/endpoints/ref_data.rb +27 -0
- data/lib/iex/endpoints/stock_market.rb +11 -0
- data/lib/iex/resources.rb +6 -0
- data/lib/iex/resources/advanced_stats.rb +84 -0
- data/lib/iex/resources/balance_sheet.rb +60 -0
- data/lib/iex/resources/cash_flow.rb +43 -0
- data/lib/iex/resources/historical_prices.rb +31 -0
- data/lib/iex/resources/income.rb +2 -0
- data/lib/iex/resources/key_stats.rb +1 -1
- data/lib/iex/resources/news.rb +3 -0
- data/lib/iex/resources/quote.rb +12 -2
- data/lib/iex/resources/resource.rb +12 -0
- data/lib/iex/resources/symbol.rb +10 -0
- data/lib/iex/resources/symbols.rb +19 -0
- data/lib/iex/version.rb +1 -1
- data/spec/fixtures/iex/advanced_stats/invalid.yml +50 -0
- data/spec/fixtures/iex/advanced_stats/msft.yml +57 -0
- data/spec/fixtures/iex/balance_sheet/invalid.yml +50 -0
- data/spec/fixtures/iex/balance_sheet/msft.yml +56 -0
- data/spec/fixtures/iex/cash_flow/invalid.yml +50 -0
- data/spec/fixtures/iex/cash_flow/msft.yml +56 -0
- data/spec/fixtures/iex/historical_prices/abcd.yml +56 -0
- data/spec/fixtures/iex/historical_prices/invalid.yml +50 -0
- data/spec/fixtures/iex/historical_prices/invalid_date.yml +50 -0
- data/spec/fixtures/iex/historical_prices/invalid_range.yml +47 -0
- data/spec/fixtures/iex/historical_prices/msft.yml +79 -0
- data/spec/fixtures/iex/historical_prices/msft_5d.yml +61 -0
- data/spec/fixtures/iex/historical_prices/msft_date_and_chart_by_day.yml +57 -0
- data/spec/fixtures/iex/historical_prices/msft_specific_date_trimmed.yml +445 -0
- data/spec/fixtures/iex/income/msft.yml +54 -51
- data/spec/fixtures/iex/ref-data/exchange_symbols.yml +1926 -0
- data/spec/fixtures/iex/ref-data/isin.yml +9 -9
- data/spec/fixtures/iex/ref-data/isin_mapped.yml +57 -0
- data/spec/fixtures/iex/ref-data/symbols.yml +9002 -0
- data/spec/fixtures/iex/ref-data/wrong_isin_mapped.yml +57 -0
- data/spec/fixtures/iex/stock_market/list_mostactive.yml +76 -0
- data/spec/iex/client_spec.rb +96 -13
- data/spec/iex/config/client_spec.rb +49 -0
- data/spec/iex/config/logger_spec.rb +46 -0
- data/spec/iex/endpoints/advanced_stats_spec.rb +110 -0
- data/spec/iex/endpoints/balance_sheet_spec.rb +80 -0
- data/spec/iex/endpoints/cash_flow_spec.rb +59 -0
- data/spec/iex/endpoints/historical_prices_spec.rb +206 -0
- data/spec/iex/endpoints/income_spec.rb +31 -29
- data/spec/iex/endpoints/key_stats_spec.rb +1 -0
- data/spec/iex/endpoints/news_spec.rb +3 -0
- data/spec/iex/endpoints/quote_spec.rb +2 -0
- data/spec/iex/endpoints/ref_data_spec.rb +103 -8
- data/spec/iex/endpoints/stock_market_spec.rb +14 -0
- data/spec/iex/resources/resource_spec.rb +36 -0
- data/spec/spec_helper.rb +3 -3
- metadata +74 -9
- data/lib/iex/api/config.rb +0 -47
- data/spec/iex/config_spec.rb +0 -22
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe IEX::Endpoints::StockMarket do
|
4
|
+
include_context 'client'
|
5
|
+
|
6
|
+
describe '#stock_market_list', vcr: { cassette_name: 'stock_market/list_mostactive' } do
|
7
|
+
subject { client.stock_market_list(:mostactive) }
|
8
|
+
|
9
|
+
it 'retrieves a list of quotes' do
|
10
|
+
expect(subject).to all(be_a(IEX::Resources::Quote))
|
11
|
+
expect(subject.map(&:symbol)).to match_array(%w[AAPL AMD BAC F GE INO INTC MSFT T XOM])
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -37,6 +37,42 @@ describe IEX::Resources::Resource do
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
context 'percent to string (Positive)' do
|
41
|
+
subject do
|
42
|
+
IEX::Resources::Resource.percentage_to_string(3.3793)
|
43
|
+
end
|
44
|
+
it 'converts to percentage' do
|
45
|
+
expect(subject).to eq '+3.38%'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'percent to string (Negative)' do
|
50
|
+
subject do
|
51
|
+
IEX::Resources::Resource.percentage_to_string(-3.3793)
|
52
|
+
end
|
53
|
+
it 'converts to percentage' do
|
54
|
+
expect(subject).to eq '-3.38%'
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
context 'percent to string (nil)' do
|
59
|
+
subject do
|
60
|
+
IEX::Resources::Resource.percentage_to_string(nil)
|
61
|
+
end
|
62
|
+
it 'nil argument does not convert' do
|
63
|
+
expect(subject).to eq nil
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
context 'float number to percent (0)' do
|
68
|
+
subject do
|
69
|
+
IEX::Resources::Resource.percentage_to_string(0)
|
70
|
+
end
|
71
|
+
it 'Zero converts to +0.00%' do
|
72
|
+
expect(subject).to eq '+0.00%'
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
40
76
|
context 'Unformatted money amount to dollar' do
|
41
77
|
subject do
|
42
78
|
IEX::Resources::Resource.to_dollar(amount: 123_391)
|
data/spec/spec_helper.rb
CHANGED
@@ -2,12 +2,12 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..'))
|
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'rspec'
|
5
|
+
require 'dotenv'
|
5
6
|
|
6
7
|
require 'iex-ruby-client'
|
7
8
|
|
8
|
-
Dir[File.join(File.dirname(__FILE__), 'support', '**/*.rb')].each do |file|
|
9
|
+
Dir[File.join(File.dirname(__FILE__), 'support', '**/*.rb')].sort.each do |file|
|
9
10
|
require file
|
10
11
|
end
|
11
12
|
|
12
|
-
|
13
|
-
ENV['IEX_API_SECRET_TOKEN'] ||= 'test-iex-api-secret-token'
|
13
|
+
Dotenv.load('.env', '.env.sample')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iex-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Doubrovkine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.17'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.17'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faraday_middleware
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,6 +142,8 @@ executables: []
|
|
142
142
|
extensions: []
|
143
143
|
extra_rdoc_files: []
|
144
144
|
files:
|
145
|
+
- ".env.sample"
|
146
|
+
- ".github/FUNDING.yml"
|
145
147
|
- ".gitignore"
|
146
148
|
- ".rspec"
|
147
149
|
- ".rubocop.yml"
|
@@ -160,16 +162,21 @@ files:
|
|
160
162
|
- lib/iex-ruby-client.rb
|
161
163
|
- lib/iex/api.rb
|
162
164
|
- lib/iex/api/client.rb
|
163
|
-
- lib/iex/api/config.rb
|
165
|
+
- lib/iex/api/config/client.rb
|
166
|
+
- lib/iex/api/config/logger.rb
|
164
167
|
- lib/iex/cloud.rb
|
165
168
|
- lib/iex/cloud/connection.rb
|
166
169
|
- lib/iex/cloud/request.rb
|
167
170
|
- lib/iex/cloud/response.rb
|
171
|
+
- lib/iex/endpoints/advanced_stats.rb
|
172
|
+
- lib/iex/endpoints/balance_sheet.rb
|
173
|
+
- lib/iex/endpoints/cash_flow.rb
|
168
174
|
- lib/iex/endpoints/chart.rb
|
169
175
|
- lib/iex/endpoints/company.rb
|
170
176
|
- lib/iex/endpoints/crypto.rb
|
171
177
|
- lib/iex/endpoints/dividends.rb
|
172
178
|
- lib/iex/endpoints/earnings.rb
|
179
|
+
- lib/iex/endpoints/historial_prices.rb
|
173
180
|
- lib/iex/endpoints/income.rb
|
174
181
|
- lib/iex/endpoints/key_stats.rb
|
175
182
|
- lib/iex/endpoints/largest_trades.rb
|
@@ -178,18 +185,24 @@ files:
|
|
178
185
|
- lib/iex/endpoints/ohlc.rb
|
179
186
|
- lib/iex/endpoints/price.rb
|
180
187
|
- lib/iex/endpoints/quote.rb
|
188
|
+
- lib/iex/endpoints/ref_data.rb
|
181
189
|
- lib/iex/endpoints/sectors.rb
|
190
|
+
- lib/iex/endpoints/stock_market.rb
|
182
191
|
- lib/iex/errors.rb
|
183
192
|
- lib/iex/errors/client_error.rb
|
184
193
|
- lib/iex/errors/permission_denied_error.rb
|
185
194
|
- lib/iex/errors/symbol_not_found_error.rb
|
186
195
|
- lib/iex/logger.rb
|
187
196
|
- lib/iex/resources.rb
|
197
|
+
- lib/iex/resources/advanced_stats.rb
|
198
|
+
- lib/iex/resources/balance_sheet.rb
|
199
|
+
- lib/iex/resources/cash_flow.rb
|
188
200
|
- lib/iex/resources/chart.rb
|
189
201
|
- lib/iex/resources/company.rb
|
190
202
|
- lib/iex/resources/crypto.rb
|
191
203
|
- lib/iex/resources/dividends.rb
|
192
204
|
- lib/iex/resources/earnings.rb
|
205
|
+
- lib/iex/resources/historical_prices.rb
|
193
206
|
- lib/iex/resources/income.rb
|
194
207
|
- lib/iex/resources/key_stats.rb
|
195
208
|
- lib/iex/resources/largest_trades.rb
|
@@ -199,7 +212,15 @@ files:
|
|
199
212
|
- lib/iex/resources/quote.rb
|
200
213
|
- lib/iex/resources/resource.rb
|
201
214
|
- lib/iex/resources/sectors.rb
|
215
|
+
- lib/iex/resources/symbol.rb
|
216
|
+
- lib/iex/resources/symbols.rb
|
202
217
|
- lib/iex/version.rb
|
218
|
+
- spec/fixtures/iex/advanced_stats/invalid.yml
|
219
|
+
- spec/fixtures/iex/advanced_stats/msft.yml
|
220
|
+
- spec/fixtures/iex/balance_sheet/invalid.yml
|
221
|
+
- spec/fixtures/iex/balance_sheet/msft.yml
|
222
|
+
- spec/fixtures/iex/cash_flow/invalid.yml
|
223
|
+
- spec/fixtures/iex/cash_flow/msft.yml
|
203
224
|
- spec/fixtures/iex/chart/1d.yml
|
204
225
|
- spec/fixtures/iex/chart/20190306.yml
|
205
226
|
- spec/fixtures/iex/chart/bad_option.yml
|
@@ -218,6 +239,14 @@ files:
|
|
218
239
|
- spec/fixtures/iex/dividends/msft_invalid_range.yml
|
219
240
|
- spec/fixtures/iex/earnings/invalid.yml
|
220
241
|
- spec/fixtures/iex/earnings/msft.yml
|
242
|
+
- spec/fixtures/iex/historical_prices/abcd.yml
|
243
|
+
- spec/fixtures/iex/historical_prices/invalid.yml
|
244
|
+
- spec/fixtures/iex/historical_prices/invalid_date.yml
|
245
|
+
- spec/fixtures/iex/historical_prices/invalid_range.yml
|
246
|
+
- spec/fixtures/iex/historical_prices/msft.yml
|
247
|
+
- spec/fixtures/iex/historical_prices/msft_5d.yml
|
248
|
+
- spec/fixtures/iex/historical_prices/msft_date_and_chart_by_day.yml
|
249
|
+
- spec/fixtures/iex/historical_prices/msft_specific_date_trimmed.yml
|
221
250
|
- spec/fixtures/iex/income/invalid.yml
|
222
251
|
- spec/fixtures/iex/income/msft.yml
|
223
252
|
- spec/fixtures/iex/income/nsrgy.yml
|
@@ -235,16 +264,26 @@ files:
|
|
235
264
|
- spec/fixtures/iex/price/msft.yml
|
236
265
|
- spec/fixtures/iex/quote/invalid.yml
|
237
266
|
- spec/fixtures/iex/quote/msft.yml
|
267
|
+
- spec/fixtures/iex/ref-data/exchange_symbols.yml
|
238
268
|
- spec/fixtures/iex/ref-data/isin.yml
|
269
|
+
- spec/fixtures/iex/ref-data/isin_mapped.yml
|
270
|
+
- spec/fixtures/iex/ref-data/symbols.yml
|
271
|
+
- spec/fixtures/iex/ref-data/wrong_isin_mapped.yml
|
239
272
|
- spec/fixtures/iex/sectors/invalid.yml
|
240
273
|
- spec/fixtures/iex/sectors/sectors-performance.yml
|
274
|
+
- spec/fixtures/iex/stock_market/list_mostactive.yml
|
241
275
|
- spec/iex/client_spec.rb
|
242
|
-
- spec/iex/
|
276
|
+
- spec/iex/config/client_spec.rb
|
277
|
+
- spec/iex/config/logger_spec.rb
|
278
|
+
- spec/iex/endpoints/advanced_stats_spec.rb
|
279
|
+
- spec/iex/endpoints/balance_sheet_spec.rb
|
280
|
+
- spec/iex/endpoints/cash_flow_spec.rb
|
243
281
|
- spec/iex/endpoints/chart_spec.rb
|
244
282
|
- spec/iex/endpoints/company_spec.rb
|
245
283
|
- spec/iex/endpoints/crypto_spec.rb
|
246
284
|
- spec/iex/endpoints/dividends_spec.rb
|
247
285
|
- spec/iex/endpoints/earnings_spec.rb
|
286
|
+
- spec/iex/endpoints/historical_prices_spec.rb
|
248
287
|
- spec/iex/endpoints/income_spec.rb
|
249
288
|
- spec/iex/endpoints/key_stats_spec.rb
|
250
289
|
- spec/iex/endpoints/largest_trades_spec.rb
|
@@ -255,6 +294,7 @@ files:
|
|
255
294
|
- spec/iex/endpoints/quote_spec.rb
|
256
295
|
- spec/iex/endpoints/ref_data_spec.rb
|
257
296
|
- spec/iex/endpoints/sectors_spec.rb
|
297
|
+
- spec/iex/endpoints/stock_market_spec.rb
|
258
298
|
- spec/iex/resources/resource_spec.rb
|
259
299
|
- spec/iex/version_spec.rb
|
260
300
|
- spec/spec_helper.rb
|
@@ -272,18 +312,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
272
312
|
requirements:
|
273
313
|
- - ">="
|
274
314
|
- !ruby/object:Gem::Version
|
275
|
-
version:
|
315
|
+
version: 2.3.0
|
276
316
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
277
317
|
requirements:
|
278
318
|
- - ">="
|
279
319
|
- !ruby/object:Gem::Version
|
280
320
|
version: 1.3.6
|
281
321
|
requirements: []
|
282
|
-
rubygems_version: 3.
|
322
|
+
rubygems_version: 3.1.4
|
283
323
|
signing_key:
|
284
324
|
specification_version: 4
|
285
325
|
summary: IEX Finance API Ruby client with support for retrieving stock quotes.
|
286
326
|
test_files:
|
327
|
+
- spec/fixtures/iex/advanced_stats/invalid.yml
|
328
|
+
- spec/fixtures/iex/advanced_stats/msft.yml
|
329
|
+
- spec/fixtures/iex/balance_sheet/invalid.yml
|
330
|
+
- spec/fixtures/iex/balance_sheet/msft.yml
|
331
|
+
- spec/fixtures/iex/cash_flow/invalid.yml
|
332
|
+
- spec/fixtures/iex/cash_flow/msft.yml
|
287
333
|
- spec/fixtures/iex/chart/1d.yml
|
288
334
|
- spec/fixtures/iex/chart/20190306.yml
|
289
335
|
- spec/fixtures/iex/chart/bad_option.yml
|
@@ -302,6 +348,14 @@ test_files:
|
|
302
348
|
- spec/fixtures/iex/dividends/msft_invalid_range.yml
|
303
349
|
- spec/fixtures/iex/earnings/invalid.yml
|
304
350
|
- spec/fixtures/iex/earnings/msft.yml
|
351
|
+
- spec/fixtures/iex/historical_prices/abcd.yml
|
352
|
+
- spec/fixtures/iex/historical_prices/invalid.yml
|
353
|
+
- spec/fixtures/iex/historical_prices/invalid_date.yml
|
354
|
+
- spec/fixtures/iex/historical_prices/invalid_range.yml
|
355
|
+
- spec/fixtures/iex/historical_prices/msft.yml
|
356
|
+
- spec/fixtures/iex/historical_prices/msft_5d.yml
|
357
|
+
- spec/fixtures/iex/historical_prices/msft_date_and_chart_by_day.yml
|
358
|
+
- spec/fixtures/iex/historical_prices/msft_specific_date_trimmed.yml
|
305
359
|
- spec/fixtures/iex/income/invalid.yml
|
306
360
|
- spec/fixtures/iex/income/msft.yml
|
307
361
|
- spec/fixtures/iex/income/nsrgy.yml
|
@@ -319,16 +373,26 @@ test_files:
|
|
319
373
|
- spec/fixtures/iex/price/msft.yml
|
320
374
|
- spec/fixtures/iex/quote/invalid.yml
|
321
375
|
- spec/fixtures/iex/quote/msft.yml
|
376
|
+
- spec/fixtures/iex/ref-data/exchange_symbols.yml
|
322
377
|
- spec/fixtures/iex/ref-data/isin.yml
|
378
|
+
- spec/fixtures/iex/ref-data/isin_mapped.yml
|
379
|
+
- spec/fixtures/iex/ref-data/symbols.yml
|
380
|
+
- spec/fixtures/iex/ref-data/wrong_isin_mapped.yml
|
323
381
|
- spec/fixtures/iex/sectors/invalid.yml
|
324
382
|
- spec/fixtures/iex/sectors/sectors-performance.yml
|
383
|
+
- spec/fixtures/iex/stock_market/list_mostactive.yml
|
325
384
|
- spec/iex/client_spec.rb
|
326
|
-
- spec/iex/
|
385
|
+
- spec/iex/config/client_spec.rb
|
386
|
+
- spec/iex/config/logger_spec.rb
|
387
|
+
- spec/iex/endpoints/advanced_stats_spec.rb
|
388
|
+
- spec/iex/endpoints/balance_sheet_spec.rb
|
389
|
+
- spec/iex/endpoints/cash_flow_spec.rb
|
327
390
|
- spec/iex/endpoints/chart_spec.rb
|
328
391
|
- spec/iex/endpoints/company_spec.rb
|
329
392
|
- spec/iex/endpoints/crypto_spec.rb
|
330
393
|
- spec/iex/endpoints/dividends_spec.rb
|
331
394
|
- spec/iex/endpoints/earnings_spec.rb
|
395
|
+
- spec/iex/endpoints/historical_prices_spec.rb
|
332
396
|
- spec/iex/endpoints/income_spec.rb
|
333
397
|
- spec/iex/endpoints/key_stats_spec.rb
|
334
398
|
- spec/iex/endpoints/largest_trades_spec.rb
|
@@ -339,6 +403,7 @@ test_files:
|
|
339
403
|
- spec/iex/endpoints/quote_spec.rb
|
340
404
|
- spec/iex/endpoints/ref_data_spec.rb
|
341
405
|
- spec/iex/endpoints/sectors_spec.rb
|
406
|
+
- spec/iex/endpoints/stock_market_spec.rb
|
342
407
|
- spec/iex/resources/resource_spec.rb
|
343
408
|
- spec/iex/version_spec.rb
|
344
409
|
- spec/spec_helper.rb
|
data/lib/iex/api/config.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
module IEX
|
2
|
-
module Api
|
3
|
-
module Config
|
4
|
-
extend self
|
5
|
-
|
6
|
-
ATTRIBUTES = %i[
|
7
|
-
proxy
|
8
|
-
user_agent
|
9
|
-
ca_path
|
10
|
-
ca_file
|
11
|
-
logger
|
12
|
-
timeout
|
13
|
-
open_timeout
|
14
|
-
endpoint
|
15
|
-
publishable_token
|
16
|
-
secret_token
|
17
|
-
].freeze
|
18
|
-
|
19
|
-
attr_accessor(*Config::ATTRIBUTES)
|
20
|
-
|
21
|
-
def reset!
|
22
|
-
self.endpoint = 'https://cloud.iexapis.com/v1'
|
23
|
-
self.publishable_token = ENV['IEX_API_PUBLISHABLE_TOKEN']
|
24
|
-
self.secret_token = ENV['IEX_API_SECRET_TOKEN']
|
25
|
-
self.user_agent = "IEX Ruby Client/#{IEX::VERSION}"
|
26
|
-
self.ca_path = defined?(OpenSSL) ? OpenSSL::X509::DEFAULT_CERT_DIR : nil
|
27
|
-
self.ca_file = defined?(OpenSSL) ? OpenSSL::X509::DEFAULT_CERT_FILE : nil
|
28
|
-
self.proxy = nil
|
29
|
-
self.logger = nil
|
30
|
-
self.timeout = nil
|
31
|
-
self.open_timeout = nil
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
class << self
|
36
|
-
def configure
|
37
|
-
block_given? ? yield(Config) : Config
|
38
|
-
end
|
39
|
-
|
40
|
-
def config
|
41
|
-
Config
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
IEX::Api::Config.reset!
|
data/spec/iex/config_spec.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe IEX::Api::Config do
|
4
|
-
before do
|
5
|
-
IEX::Api.config.reset!
|
6
|
-
end
|
7
|
-
describe '#defaults' do
|
8
|
-
it 'sets endpoint' do
|
9
|
-
expect(IEX::Api.config.endpoint).to eq 'https://cloud.iexapis.com/v1'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
describe '#configure' do
|
13
|
-
before do
|
14
|
-
IEX::Api.configure do |config|
|
15
|
-
config.endpoint = 'updated'
|
16
|
-
end
|
17
|
-
end
|
18
|
-
it 'sets endpoint' do
|
19
|
-
expect(IEX::Api.config.endpoint).to eq 'updated'
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|