iex-ruby-client 1.3.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +21 -0
  4. data/README.md +202 -16
  5. data/RELEASING.md +3 -3
  6. data/UPGRADING.md +8 -0
  7. data/iex-ruby-client.gemspec +1 -1
  8. data/lib/iex/api/client.rb +5 -0
  9. data/lib/iex/api.rb +5 -0
  10. data/lib/iex/endpoints/balance_sheet.rb +13 -0
  11. data/lib/iex/endpoints/cash_flow.rb +13 -0
  12. data/lib/iex/endpoints/fx.rb +13 -0
  13. data/lib/iex/endpoints/historial_prices.rb +30 -0
  14. data/lib/iex/endpoints/key_stat.rb +14 -0
  15. data/lib/iex/endpoints/ref_data.rb +5 -0
  16. data/lib/iex/errors/invalid_symbols_list.rb +14 -0
  17. data/lib/iex/errors/stat_not_found_error.rb +13 -0
  18. data/lib/iex/errors.rb +3 -1
  19. data/lib/iex/resources/advanced_stats.rb +43 -1
  20. data/lib/iex/resources/balance_sheet.rb +60 -0
  21. data/lib/iex/resources/cash_flow.rb +43 -0
  22. data/lib/iex/resources/currency_rate.rb +9 -0
  23. data/lib/iex/resources/historical_prices.rb +31 -0
  24. data/lib/iex/resources/income.rb +2 -0
  25. data/lib/iex/resources/news.rb +3 -0
  26. data/lib/iex/resources/resource.rb +17 -1
  27. data/lib/iex/resources.rb +4 -0
  28. data/lib/iex/version.rb +1 -1
  29. data/lib/iex-ruby-client.rb +1 -1
  30. data/script/console +9 -0
  31. data/spec/fixtures/iex/balance_sheet/invalid.yml +50 -0
  32. data/spec/fixtures/iex/balance_sheet/msft.yml +56 -0
  33. data/spec/fixtures/iex/cash_flow/invalid.yml +50 -0
  34. data/spec/fixtures/iex/cash_flow/msft.yml +56 -0
  35. data/spec/fixtures/iex/fx/invalid.yml +83 -0
  36. data/spec/fixtures/iex/fx/latest.yml +85 -0
  37. data/spec/fixtures/iex/fx/latest_one_symbol.yml +85 -0
  38. data/spec/fixtures/iex/historical_prices/abcd.yml +56 -0
  39. data/spec/fixtures/iex/historical_prices/invalid.yml +50 -0
  40. data/spec/fixtures/iex/historical_prices/invalid_date.yml +50 -0
  41. data/spec/fixtures/iex/historical_prices/invalid_range.yml +47 -0
  42. data/spec/fixtures/iex/historical_prices/msft.yml +79 -0
  43. data/spec/fixtures/iex/historical_prices/msft_5d.yml +61 -0
  44. data/spec/fixtures/iex/historical_prices/msft_date_and_chart_by_day.yml +57 -0
  45. data/spec/fixtures/iex/historical_prices/msft_specific_date_trimmed.yml +445 -0
  46. data/spec/fixtures/iex/income/msft.yml +54 -51
  47. data/spec/fixtures/iex/key_stat/individual.yml +60 -0
  48. data/spec/fixtures/iex/key_stat/invalid_stat.yml +60 -0
  49. data/spec/fixtures/iex/key_stat/invalid_symbol.yml +50 -0
  50. data/spec/fixtures/iex/ref-data/exchange_symbols.yml +1926 -0
  51. data/spec/iex/endpoints/advanced_stats_spec.rb +56 -0
  52. data/spec/iex/endpoints/balance_sheet_spec.rb +80 -0
  53. data/spec/iex/endpoints/cash_flow_spec.rb +59 -0
  54. data/spec/iex/endpoints/fx_spec.rb +48 -0
  55. data/spec/iex/endpoints/historical_prices_spec.rb +206 -0
  56. data/spec/iex/endpoints/income_spec.rb +31 -29
  57. data/spec/iex/endpoints/key_stat_spec.rb +43 -0
  58. data/spec/iex/endpoints/news_spec.rb +3 -0
  59. data/spec/iex/endpoints/ref_data_spec.rb +44 -9
  60. data/spec/iex/resources/resource_spec.rb +36 -0
  61. metadata +68 -8
@@ -1,53 +1,56 @@
1
1
  ---
2
2
  http_interactions:
3
- - request:
4
- method: get
5
- uri: https://cloud.iexapis.com/v1/stock/MSFT/income?token=test-iex-api-publishable-token
6
- body:
7
- encoding: US-ASCII
8
- string: ""
9
- headers:
10
- Accept:
11
- - application/json; charset=utf-8
12
- User-Agent:
13
- - IEX Ruby Client/1.0.1
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- response:
17
- status:
18
- code: 200
19
- message: OK
20
- headers:
21
- Server:
22
- - nginx
23
- Date:
24
- - Mon, 08 Jul 2019 04:53:26 GMT
25
- Content-Type:
26
- - application/json; charset=utf-8
27
- Transfer-Encoding:
28
- - chunked
29
- Connection:
30
- - keep-alive
31
- Set-Cookie:
32
- - ctoken=153fb65c56854cf995c8112a5cd5f554; Max-Age=43200; Path=/; Expires=Mon,
33
- 08 Jul 2019 16:53:26 GMT
34
- Iexcloud-Messages-Used:
35
- - "1000"
36
- X-Content-Type-Options:
37
- - nosniff
38
- Strict-Transport-Security:
39
- - max-age=15768000
40
- Access-Control-Allow-Origin:
41
- - "*"
42
- Access-Control-Allow-Credentials:
43
- - "true"
44
- Access-Control-Allow-Methods:
45
- - GET, OPTIONS
46
- Access-Control-Allow-Headers:
47
- - Origin, X-Requested-With, Content-Type, Accept
48
- body:
49
- encoding: ASCII-8BIT
50
- string: '{"symbol":"MSFT","income":[{"reportDate":"2019-03-31","totalRevenue":30505000000,"costOfRevenue":10170000000,"grossProfit":20335000000,"researchAndDevelopment":4316000000,"sellingGeneralAndAdmin":5744000000,"operatingExpense":20230000000,"operatingIncome":10275000000,"otherIncomeExpenseNet":211000000,"ebit":10275000000,"interestIncome":671000000,"pretaxIncome":10486000000,"incomeTax":1677000000,"minorityInterest":0,"netIncome":8809000000,"netIncomeBasic":8809000000}]}'
51
- http_version:
52
- recorded_at: Mon, 08 Jul 2019 04:53:26 GMT
53
- recorded_with: VCR 4.0.0
3
+ - request:
4
+ method: get
5
+ uri: https://cloud.iexapis.com/v1/stock/MSFT/income?token=test-iex-api-publishable-token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ Content-Type:
13
+ - application/json; charset=utf-8
14
+ User-Agent:
15
+ - IEX Ruby Client/1.3.1
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Sat, 07 Nov 2020 21:59:07 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - ctoken=88f9e21273b94c5683bb6f7214f0ad64; Max-Age=43200; Path=/; Expires=Sun,
35
+ 08 Nov 2020 09:59:07 GMT
36
+ Iexcloud-Messages-Used:
37
+ - '1000'
38
+ Iexcloud-Premium-Messages-Used:
39
+ - '0'
40
+ X-Content-Type-Options:
41
+ - nosniff
42
+ Strict-Transport-Security:
43
+ - max-age=15768000
44
+ Access-Control-Allow-Origin:
45
+ - "*"
46
+ Access-Control-Allow-Credentials:
47
+ - 'true'
48
+ Access-Control-Allow-Methods:
49
+ - GET, OPTIONS
50
+ Access-Control-Allow-Headers:
51
+ - Origin, X-Requested-With, Content-Type, Accept, Request-Source
52
+ body:
53
+ encoding: ASCII-8BIT
54
+ string: '{"symbol":"MSFT","income":[{"reportDate":"2020-09-30","fiscalDate":"2020-09-30","currency":"USD","totalRevenue":37154000000,"costOfRevenue":11002000000,"grossProfit":26152000000,"researchAndDevelopment":4926000000,"sellingGeneralAndAdmin":5350000000,"operatingExpense":21278000000,"operatingIncome":15876000000,"otherIncomeExpenseNet":248000000,"ebit":15876000000,"interestIncome":589000000,"pretaxIncome":16124000000,"incomeTax":2231000000,"minorityInterest":0,"netIncome":13893000000,"netIncomeBasic":13893000000}]}'
55
+ recorded_at: Sat, 07 Nov 2020 21:59:07 GMT
56
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,60 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cloud.iexapis.com/v1/stock/VTI/stats/ttmDividendRate?token=test-iex-api-publishable-token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ Content-Type:
13
+ - application/json; charset=utf-8
14
+ User-Agent:
15
+ - IEX Ruby Client/1.4.2
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Thu, 12 Aug 2021 20:04:24 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Content-Length:
30
+ - '18'
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - ctoken=8df9fdfb440744638edd9bfdc8e0d27b; Max-Age=43200; Path=/; Expires=Fri,
35
+ 13 Aug 2021 08:04:24 GMT
36
+ Iexcloud-Messages-Used:
37
+ - '2'
38
+ Iexcloud-Credits-Used:
39
+ - '2'
40
+ Iexcloud-Premium-Messages-Used:
41
+ - '0'
42
+ Iexcloud-Premium-Credits-Used:
43
+ - '0'
44
+ X-Content-Type-Options:
45
+ - nosniff
46
+ Strict-Transport-Security:
47
+ - max-age=15768000
48
+ Access-Control-Allow-Origin:
49
+ - "*"
50
+ Access-Control-Allow-Credentials:
51
+ - 'true'
52
+ Access-Control-Allow-Methods:
53
+ - GET, OPTIONS
54
+ Access-Control-Allow-Headers:
55
+ - Origin, X-Requested-With, Content-Type, Accept, Request-Source
56
+ body:
57
+ encoding: UTF-8
58
+ string: '2.7887693754001748'
59
+ recorded_at: Thu, 12 Aug 2021 20:04:24 GMT
60
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,60 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cloud.iexapis.com/v1/stock/VTI/stats/INVALID?token=test-iex-api-publishable-token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ Content-Type:
13
+ - application/json; charset=utf-8
14
+ User-Agent:
15
+ - IEX Ruby Client/1.4.2
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Fri, 13 Aug 2021 17:45:21 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - ctoken=f9f32af4b36f4a1bac8e9b2ff9018275; Max-Age=43200; Path=/; Expires=Sat,
35
+ 14 Aug 2021 05:45:21 GMT
36
+ Iexcloud-Messages-Used:
37
+ - '6'
38
+ Iexcloud-Credits-Used:
39
+ - '6'
40
+ Iexcloud-Premium-Messages-Used:
41
+ - '0'
42
+ Iexcloud-Premium-Credits-Used:
43
+ - '0'
44
+ X-Content-Type-Options:
45
+ - nosniff
46
+ Strict-Transport-Security:
47
+ - max-age=15768000
48
+ Access-Control-Allow-Origin:
49
+ - "*"
50
+ Access-Control-Allow-Credentials:
51
+ - 'true'
52
+ Access-Control-Allow-Methods:
53
+ - GET, OPTIONS
54
+ Access-Control-Allow-Headers:
55
+ - Origin, X-Requested-With, Content-Type, Accept, Request-Source
56
+ body:
57
+ encoding: ASCII-8BIT
58
+ string: '{"companyName":"Vanguard Group, Inc.","marketcap":260737447690,"week52high":230.02,"week52low":160.5,"week52highSplitAdjustOnly":230.02,"week52lowSplitAdjustOnly":162.85,"week52change":0.3645993202513256,"sharesOutstanding":1133542508,"float":0,"avg10Volume":2888645,"avg30Volume":3320395,"day200MovingAvg":213.89,"day50MovingAvg":225.73,"employees":0,"ttmEPS":0,"ttmDividendRate":2.788769375400175,"dividendYield":0.012124029977394032,"nextDividendDate":"","exDividendDate":"2021-06-24","nextEarningsDate":"","peRatio":0,"beta":1.0132372909433216,"maxChangePercent":3.578068183401369,"year5ChangePercent":1.249480952953752,"year2ChangePercent":0.6180018710916342,"year1ChangePercent":0.3635630717574918,"ytdChangePercent":0.1893429658290111,"month6ChangePercent":0.1156861042707178,"month3ChangePercent":0.10073637646122013,"month1ChangePercent":0.015496004591408763,"day30ChangePercent":0.021176470588235352,"day5ChangePercent":0.006255741720985197}'
59
+ recorded_at: Fri, 13 Aug 2021 17:45:21 GMT
60
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cloud.iexapis.com/v1/stock/INVALID/stats/ttmDividendRate?token=test-iex-api-publishable-token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ Content-Type:
13
+ - application/json; charset=utf-8
14
+ User-Agent:
15
+ - IEX Ruby Client/1.4.2
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 404
21
+ message: Not Found
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Fri, 13 Aug 2021 17:45:20 GMT
27
+ Content-Type:
28
+ - text/html; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - ctoken=8e6f76d57e134a4ca1be468312f5f33c; Max-Age=43200; Path=/; Expires=Sat,
35
+ 14 Aug 2021 05:45:20 GMT
36
+ Strict-Transport-Security:
37
+ - max-age=15768000
38
+ Access-Control-Allow-Origin:
39
+ - "*"
40
+ Access-Control-Allow-Credentials:
41
+ - 'true'
42
+ Access-Control-Allow-Methods:
43
+ - GET, OPTIONS
44
+ Access-Control-Allow-Headers:
45
+ - Origin, X-Requested-With, Content-Type, Accept, Request-Source
46
+ body:
47
+ encoding: ASCII-8BIT
48
+ string: Unknown symbol
49
+ recorded_at: Fri, 13 Aug 2021 17:45:20 GMT
50
+ recorded_with: VCR 6.0.0