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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd38ba3dabb637a579797d9dbfa635bf84750a6e39ffbe98810d3665098b94ba
4
- data.tar.gz: '0896beedbf3f06f69687b7b8e76f652f287cf776859911f61f6babe1322fc09c'
3
+ metadata.gz: d03e86f7d366b3333ea39f34938d3cfb5ce295bf6077405572a6c9d3ec9b31ef
4
+ data.tar.gz: ea948f46612499bb2712a45a4dcf6bd9e7683d9615ade101dfe6efff4eda662b
5
5
  SHA512:
6
- metadata.gz: 82ee3b246f777fb1e677476e2d3c6306986745a131038117a1a98c1c5c729ff1b4fcab5922be281a5e0e71d39102b1c9cefb7be8ef240f3398c8a8460a778ea7
7
- data.tar.gz: 75b8d8e31b7863237af447952fa92661b8883bf70de55452999d4d21c0018608ba1371f3db063d83f2c006b46abe4b5c7cc0bdb60fded4ba79a110b40dc451d0
6
+ metadata.gz: 07cad6f8a683b78d2a347b4a6becbcbe7aa6f3c4e7eeaebeb2dd71ad56389f6c42989e4daebbb4beb5656d1021a867874e048ca6ec4d8c47bd67b32efd025770
7
+ data.tar.gz: bdfb6b593973277cfd852473d29bad34e89dfd006ac9792e595fe465bbeb5e519fd3f67a7015038302a431b7c9dcd8142c9a2ba42eb0b0be0a6b2d69533c0ecb
data/CHANGELOG.md CHANGED
@@ -7,4 +7,8 @@
7
7
  ## [2.0.0] - 2024-10-06
8
8
 
9
9
  - Add filter
10
- - Add sort
10
+ - Add sort
11
+
12
+ ## [2.0.1] - 2024-10-06
13
+
14
+ - Improve clean code (rubocop)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Aadyandana
4
4
  module LatestStockPrice
5
- VERSION = "2.0.0"
5
+ VERSION = "2.0.1"
6
6
  end
7
7
  end
@@ -28,9 +28,9 @@ module Aadyandana
28
28
  @api_key = api_key
29
29
  @params = params
30
30
 
31
- @datetime_attrs = [ "lastUpdateTime" ]
32
- @string_meta_attrs = [ "companyName", "industry", "isin" ]
33
- @string_attrs = [ "identifier", "symbol" ] + @string_meta_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 and type == "desc"
114
+ value *= -1 if value != Float::INFINITY && type == "desc"
120
115
  end
121
116
 
122
117
  value
123
118
  end
124
119
 
125
- stocks = stocks.reverse! if @string_attrs.include? field and type == "desc"
120
+ stocks.reverse! if (@string_attrs.include? field) && type == "desc"
126
121
 
127
122
  stocks
128
123
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aadyandana-latest_stock_price
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - agus.adyandana