aadyandana-latest_stock_price 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/aadyandana/latest_stock_price/version.rb +1 -1
- data/lib/aadyandana/latest_stock_price.rb +6 -11
- 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: d03e86f7d366b3333ea39f34938d3cfb5ce295bf6077405572a6c9d3ec9b31ef
|
4
|
+
data.tar.gz: ea948f46612499bb2712a45a4dcf6bd9e7683d9615ade101dfe6efff4eda662b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07cad6f8a683b78d2a347b4a6becbcbe7aa6f3c4e7eeaebeb2dd71ad56389f6c42989e4daebbb4beb5656d1021a867874e048ca6ec4d8c47bd67b32efd025770
|
7
|
+
data.tar.gz: bdfb6b593973277cfd852473d29bad34e89dfd006ac9792e595fe465bbeb5e519fd3f67a7015038302a431b7c9dcd8142c9a2ba42eb0b0be0a6b2d69533c0ecb
|
data/CHANGELOG.md
CHANGED
@@ -28,9 +28,9 @@ module Aadyandana
|
|
28
28
|
@api_key = api_key
|
29
29
|
@params = params
|
30
30
|
|
31
|
-
@datetime_attrs = [
|
32
|
-
@string_meta_attrs = [
|
33
|
-
@string_attrs = [
|
31
|
+
@datetime_attrs = %w[lastUpdateTime]
|
32
|
+
@string_meta_attrs = %w[companyName industry isin]
|
33
|
+
@string_attrs = %w[identifier symbol] + @string_meta_attrs
|
34
34
|
end
|
35
35
|
|
36
36
|
def price
|
@@ -73,12 +73,7 @@ module Aadyandana
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def get
|
76
|
-
response = self.class.get(
|
77
|
-
"/any",
|
78
|
-
{
|
79
|
-
headers: headers
|
80
|
-
}
|
81
|
-
)
|
76
|
+
response = self.class.get("/any", { headers: headers })
|
82
77
|
|
83
78
|
raise Error, "Error fetching data: #{response.message}" unless response.success?
|
84
79
|
|
@@ -116,13 +111,13 @@ module Aadyandana
|
|
116
111
|
value = value.present? ? value.downcase : "zzz"
|
117
112
|
else
|
118
113
|
value = value == "-" ? Float::INFINITY : value.to_f
|
119
|
-
value *= -1 if value != Float::INFINITY
|
114
|
+
value *= -1 if value != Float::INFINITY && type == "desc"
|
120
115
|
end
|
121
116
|
|
122
117
|
value
|
123
118
|
end
|
124
119
|
|
125
|
-
stocks
|
120
|
+
stocks.reverse! if (@string_attrs.include? field) && type == "desc"
|
126
121
|
|
127
122
|
stocks
|
128
123
|
end
|