iex-ruby-client 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,9 @@ describe IEX::Resources::News do
14
14
  expect(news.datetime.to_f).to eq 1_554_412_248.0
15
15
  expect(news.headline).to eq "Spotify joins Microsoft's Xbox Game Bar"
16
16
  expect(news.related).to eq(['MSFT'])
17
+ expect(news.image).to eq('https://cloud.iexapis.com/beta/news/image/b8a6ae18-ab19-42e8-b066-d9a9dc111f1f')
18
+ expect(news.paywalled).to eq(false)
19
+ expect(news.language).to eq('en')
17
20
  end
18
21
  end
19
22
  context 'with range', vcr: { cassette_name: 'news/msft_7' } do
@@ -9,8 +9,10 @@ describe IEX::Api::Client do
9
9
 
10
10
  it 'converts ISIN to IEX Cloud symbols' do
11
11
  expect(subject.count).to eq(2)
12
- expect(subject.first).to eq('exchange' => 'NAS', 'iex_id' => 'IEX_4D48333344362D52', 'region' => 'US', 'symbol' => 'AAPL')
13
- expect(subject.last).to eq('exchange' => 'ETR', 'iex_id' => 'IEX_464D46474C312D52', 'region' => 'DE', 'symbol' => 'APC-GY')
12
+ expect(subject.first).to eq('exchange' => 'NAS', 'iex_id' => 'IEX_4D48333344362D52', 'region' => 'US',
13
+ 'symbol' => 'AAPL')
14
+ expect(subject.last).to eq('exchange' => 'ETR', 'iex_id' => 'IEX_464D46474C312D52', 'region' => 'DE',
15
+ 'symbol' => 'APC-GY')
14
16
  end
15
17
  end
16
18
 
@@ -19,8 +21,10 @@ describe IEX::Api::Client do
19
21
 
20
22
  it 'converts ISIN to IEX Cloud symbols' do
21
23
  expect(subject.count).to eq(2)
22
- expect(subject.first).to eq('exchange' => 'NAS', 'iex_id' => 'IEX_4D48333344362D52', 'region' => 'US', 'symbol' => 'AAPL')
23
- expect(subject.last).to eq('exchange' => 'ETR', 'iex_id' => 'IEX_464D46474C312D52', 'region' => 'DE', 'symbol' => 'APC-GY')
24
+ expect(subject.first).to eq('exchange' => 'NAS', 'iex_id' => 'IEX_4D48333344362D52', 'region' => 'US',
25
+ 'symbol' => 'AAPL')
26
+ expect(subject.last).to eq('exchange' => 'ETR', 'iex_id' => 'IEX_464D46474C312D52', 'region' => 'DE',
27
+ 'symbol' => 'APC-GY')
24
28
  end
25
29
  end
26
30
 
@@ -30,12 +34,17 @@ describe IEX::Api::Client do
30
34
  it 'converts ISINs to IEX Cloud symbols mapped by ISIN' do
31
35
  expect(subject.keys).to contain_exactly('US0378331005', 'US5949181045')
32
36
 
33
- expect(subject['US0378331005'].first).to eq('exchange' => 'NAS', 'iex_id' => 'IEX_4D48333344362D52', 'region' => 'US', 'symbol' => 'AAPL')
34
- expect(subject['US0378331005'].last).to eq('exchange' => 'ETR', 'iex_id' => 'IEX_464D46474C312D52', 'region' => 'DE', 'symbol' => 'APC-GY')
37
+ expect(subject['US0378331005'].first).to eq('exchange' => 'NAS', 'iex_id' => 'IEX_4D48333344362D52',
38
+ 'region' => 'US', 'symbol' => 'AAPL')
39
+ expect(subject['US0378331005'].last).to eq('exchange' => 'ETR', 'iex_id' => 'IEX_464D46474C312D52',
40
+ 'region' => 'DE', 'symbol' => 'APC-GY')
35
41
 
36
- expect(subject['US5949181045'][0]).to eq('exchange' => 'NAS', 'iex_id' => 'IEX_5038523343322D52', 'region' => 'US', 'symbol' => 'MSFT')
37
- expect(subject['US5949181045'][1]).to eq('exchange' => 'ETR', 'iex_id' => 'IEX_4C42583859482D52', 'region' => 'DE', 'symbol' => 'MSF-GY')
38
- expect(subject['US5949181045'][2]).to eq('exchange' => 'BRU', 'iex_id' => 'IEX_5833345950432D52', 'region' => 'BE', 'symbol' => 'MSF-BB')
42
+ expect(subject['US5949181045'][0]).to eq('exchange' => 'NAS', 'iex_id' => 'IEX_5038523343322D52',
43
+ 'region' => 'US', 'symbol' => 'MSFT')
44
+ expect(subject['US5949181045'][1]).to eq('exchange' => 'ETR', 'iex_id' => 'IEX_4C42583859482D52',
45
+ 'region' => 'DE', 'symbol' => 'MSF-GY')
46
+ expect(subject['US5949181045'][2]).to eq('exchange' => 'BRU', 'iex_id' => 'IEX_5833345950432D52',
47
+ 'region' => 'BE', 'symbol' => 'MSF-BB')
39
48
  end
40
49
  end
41
50
 
@@ -73,4 +82,30 @@ describe IEX::Api::Client do
73
82
  end
74
83
  end
75
84
  end
85
+
86
+ describe '#ref_data_symbols_for_exchange', vcr: { cassette_name: 'ref-data/exchange_symbols' } do
87
+ subject { client.ref_data_symbols_for_exchange('TSX') }
88
+
89
+ it 'retrieves all symbols' do
90
+ expect(subject.count).to eq 1869
91
+ end
92
+
93
+ context 'first symbol' do
94
+ subject { client.ref_data_symbols_for_exchange('TSX').first }
95
+ it 'retrieves a symbol data' do
96
+ expect(subject.symbol).to eq 'A-CV'
97
+ expect(subject.exchange).to eq 'TSX'
98
+ expect(subject.name).to eq 'Armor Minerals Inc'
99
+ expect(subject.date).to eq Date.parse('2021-05-14')
100
+ expect(subject.enabled).to eq true
101
+ expect(subject.enabled?).to eq true
102
+ expect(subject.type).to eq 'cs'
103
+ expect(subject.region).to eq 'CA'
104
+ expect(subject.currency).to eq 'CAD'
105
+ expect(subject.iex_id).to eq 'IEX_4656374258322D52'
106
+ expect(subject.figi).to eq 'BBG000V98LH2'
107
+ expect(subject.cik).to eq '0001682145'
108
+ end
109
+ end
110
+ end
76
111
  end
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.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-19 00:00:00.000000000 Z
11
+ date: 2021-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- description:
139
+ description:
140
140
  email: dblock@dblock.org
141
141
  executables: []
142
142
  extensions: []
@@ -264,6 +264,7 @@ files:
264
264
  - spec/fixtures/iex/price/msft.yml
265
265
  - spec/fixtures/iex/quote/invalid.yml
266
266
  - spec/fixtures/iex/quote/msft.yml
267
+ - spec/fixtures/iex/ref-data/exchange_symbols.yml
267
268
  - spec/fixtures/iex/ref-data/isin.yml
268
269
  - spec/fixtures/iex/ref-data/isin_mapped.yml
269
270
  - spec/fixtures/iex/ref-data/symbols.yml
@@ -303,7 +304,7 @@ homepage: http://github.com/dblock/iex-ruby-client
303
304
  licenses:
304
305
  - MIT
305
306
  metadata: {}
306
- post_install_message:
307
+ post_install_message:
307
308
  rdoc_options: []
308
309
  require_paths:
309
310
  - lib
@@ -318,8 +319,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
318
319
  - !ruby/object:Gem::Version
319
320
  version: 1.3.6
320
321
  requirements: []
321
- rubygems_version: 3.0.3
322
- signing_key:
322
+ rubygems_version: 3.1.4
323
+ signing_key:
323
324
  specification_version: 4
324
325
  summary: IEX Finance API Ruby client with support for retrieving stock quotes.
325
326
  test_files:
@@ -372,6 +373,7 @@ test_files:
372
373
  - spec/fixtures/iex/price/msft.yml
373
374
  - spec/fixtures/iex/quote/invalid.yml
374
375
  - spec/fixtures/iex/quote/msft.yml
376
+ - spec/fixtures/iex/ref-data/exchange_symbols.yml
375
377
  - spec/fixtures/iex/ref-data/isin.yml
376
378
  - spec/fixtures/iex/ref-data/isin_mapped.yml
377
379
  - spec/fixtures/iex/ref-data/symbols.yml