eodhd 0.19.12 → 0.19.13
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.
- checksums.yaml +4 -4
- data/CHANGELOG +9 -0
- data/lib/Eodhd/VERSION.rb +1 -1
- data/lib/Eodhd/WebSocketClient.rb +4 -4
- data/test/Eodhd/WebSocketClient_test.rb +40 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: debc917c46b895d48892c6fdb0d0845c980fe26e0be451230e62594329083308
|
|
4
|
+
data.tar.gz: 00a5e08410c0a4791be2b87f9392c94958e9eea54b7204c8f86ef8814280aec6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c15a73dd3d5255dc193f7cd02705d5df4df606e8f016bfbccbafbc9e5a05322d23a1c08864ef0d8ca4353a8ae409db40dbed07769a37412ada78344dccb46714
|
|
7
|
+
data.tar.gz: e0ae570d9434bc3b83e2f9bbf2ff80ce8076544f0b50b93d044fde186f398b3cab85dd48193480c37e51bd6f4638960e38537b701566d5ac717532a4945b2d5f
|
data/CHANGELOG
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# eodhd/CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 20261024
|
|
4
|
+
|
|
5
|
+
0.19.13: Fix WebSocketClient.us_trade, .us_quote, .forex and .crypto.
|
|
6
|
+
|
|
7
|
+
1. ~ Eodhd::WebSocketClient.us_trade, .us_quote, .forex and .crypto: /self.class.new/new/. Within class << self, self.class is Class, so each raised TypeError.
|
|
8
|
+
2. + test/Eodhd/WebSocketClient_test.rb: that .us_trade, .us, .us_quote, .forex and .crypto each make a client for their stream.
|
|
9
|
+
3. ~ Eodhd::VERSION: /0.19.12/0.19.13/
|
|
10
|
+
|
|
11
|
+
|
|
3
12
|
## 20261021
|
|
4
13
|
|
|
5
14
|
0.19.12: Require http.rb >= 1.7.0, for case-sensitive filesystems.
|
data/lib/Eodhd/VERSION.rb
CHANGED
|
@@ -63,20 +63,20 @@ class Eodhd
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def us_trade(api_token:, symbols:, consumer:)
|
|
66
|
-
|
|
66
|
+
new(api_token: api_token, asset_class: 'us', symbols: symbols, consumer: consumer)
|
|
67
67
|
end
|
|
68
68
|
alias_method :us, :us_trade
|
|
69
69
|
|
|
70
70
|
def us_quote(api_token:, symbols:, consumer:)
|
|
71
|
-
|
|
71
|
+
new(api_token: api_token, asset_class: 'us-quote', symbols: symbols, consumer: consumer)
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
def forex(api_token:, symbols:, consumer:)
|
|
75
|
-
|
|
75
|
+
new(api_token: api_token, asset_class: 'forex', symbols: symbols, consumer: consumer)
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
def crypto(api_token:, symbols:, consumer:)
|
|
79
|
-
|
|
79
|
+
new(api_token: api_token, asset_class: 'crypto', symbols: symbols, consumer: consumer)
|
|
80
80
|
end
|
|
81
81
|
end # class << self
|
|
82
82
|
|
|
@@ -6,6 +6,46 @@ describe Eodhd::WebSocketClient do
|
|
|
6
6
|
let(:api_token){ENV.fetch('EODHD_API_TOKEN', '<API_TOKEN>')}
|
|
7
7
|
let(:consumer){->(data){}}
|
|
8
8
|
|
|
9
|
+
describe ".us_trade" do
|
|
10
|
+
it "makes a client for the US trade stream" do
|
|
11
|
+
client = Eodhd::WebSocketClient.us_trade(api_token: api_token, symbols: 'AAPL', consumer: consumer)
|
|
12
|
+
_(client).must_be_instance_of(Eodhd::WebSocketClient)
|
|
13
|
+
_(client.asset_class).must_equal('us')
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
describe ".us" do
|
|
18
|
+
it "makes a client for the US trade stream" do
|
|
19
|
+
client = Eodhd::WebSocketClient.us(api_token: api_token, symbols: 'AAPL', consumer: consumer)
|
|
20
|
+
_(client).must_be_instance_of(Eodhd::WebSocketClient)
|
|
21
|
+
_(client.asset_class).must_equal('us')
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
describe ".us_quote" do
|
|
26
|
+
it "makes a client for the US quote stream" do
|
|
27
|
+
client = Eodhd::WebSocketClient.us_quote(api_token: api_token, symbols: 'AAPL', consumer: consumer)
|
|
28
|
+
_(client).must_be_instance_of(Eodhd::WebSocketClient)
|
|
29
|
+
_(client.asset_class).must_equal('us-quote')
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
describe ".forex" do
|
|
34
|
+
it "makes a client for the forex stream" do
|
|
35
|
+
client = Eodhd::WebSocketClient.forex(api_token: api_token, symbols: 'EURUSD', consumer: consumer)
|
|
36
|
+
_(client).must_be_instance_of(Eodhd::WebSocketClient)
|
|
37
|
+
_(client.asset_class).must_equal('forex')
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
describe ".crypto" do
|
|
42
|
+
it "makes a client for the crypto stream" do
|
|
43
|
+
client = Eodhd::WebSocketClient.crypto(api_token: api_token, symbols: 'BTC-USD', consumer: consumer)
|
|
44
|
+
_(client).must_be_instance_of(Eodhd::WebSocketClient)
|
|
45
|
+
_(client.asset_class).must_equal('crypto')
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
9
49
|
describe "#initialize" do
|
|
10
50
|
it "accepts array of symbols and formats to comma-separated string" do
|
|
11
51
|
client = Eodhd::WebSocketClient.new(api_token: api_token, asset_class: 'us', symbols: ['AAPL', 'MSFT'], consumer: consumer)
|