Skip to content

Commit de164b9

Browse files
committed
rubocop
1 parent 88a07ff commit de164b9

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

lib/ipinfo.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff 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

test/ipinfo_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)