Skip to content

Commit

Permalink
Fix Style/HashEachMethods
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Dec 14, 2023
1 parent 263d37f commit d418a4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/whois/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def find_for_ip(string)
begin
ip = IPAddr.new(string)
type = ip.ipv4? ? TYPE_IPV4 : TYPE_IPV6
_definitions(type).each do |_, definition|
_definitions(type).each_value do |definition|
return factory(type, *definition) if IPAddr.new(definition.first).include?(ip)
end
rescue ArgumentError
Expand Down Expand Up @@ -321,7 +321,7 @@ def find_for_domain(string)
def find_for_asn(string)
asn = string[/\d+/].to_i
asn_type = asn <= 65_535 ? TYPE_ASN16 : TYPE_ASN32
_definitions(asn_type).each do |_, definition|
_definitions(asn_type).each_value do |definition|
if (range = definition.first.split.map(&:to_i)) && asn >= range.first && asn <= range.last
return factory(asn_type, *definition)
end
Expand Down

0 comments on commit d418a4b

Please sign in to comment.