File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,7 @@ def details(ip_address = nil)
6464
6565 def request_details ( ip_address = nil )
6666 res = @cache . get ( ip_address )
67- if res != nil
68- return res
69- end
67+ return res unless res . nil?
7068
7169 response = @httpc . get ( escape_path ( ip_address ) )
7270
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ def test_lookup_ip6
8383 ipinfo = IPinfo . create ( ENV [ 'IPINFO_TOKEN' ] )
8484
8585 # multiple checks for cache
86- for _ in 0 ...5
86+ ( 0 ...5 ) . each do | _ |
8787 resp = ipinfo . details ( TEST_IPV6 )
8888 assert_ip6 ( resp )
8989 end
@@ -151,7 +151,7 @@ def test_lookup_ip4
151151 ipinfo = IPinfo . create ( ENV [ 'IPINFO_TOKEN' ] )
152152
153153 # multiple checks for cache
154- for _ in 0 ...5
154+ ( 0 ...5 ) . each do | _ |
155155 resp = ipinfo . details ( TEST_IPV4 )
156156 assert_ip4 ( resp )
157157 end
You can’t perform that action at this time.
0 commit comments