Skip to content

Commit 02c341c

Browse files
committed
Use Integer#allbits? and Integer#nobits? for rubocop.
1 parent 61ac5ce commit 02c341c

File tree

1 file changed

+2
-2
lines changed
  • lib/ronin/support/network

1 file changed

+2
-2
lines changed

lib/ronin/support/network/ip.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def self.extract(text,version=nil,&block)
289289
#
290290
def broadcast?
291291
# NOTE: IPv6 does not have broadcast addresses
292-
ipv4? && (@addr & 0xff) == 0xff
292+
ipv4? && @addr.allbits?(0xff) # IPv4: A.B.C.255
293293
end
294294

295295
#
@@ -309,7 +309,7 @@ def broadcast?
309309
# # => false
310310
#
311311
def logical?
312-
ipv4? && (@addr & 0xff) == 0x00
312+
ipv4? && @addr.nobits?(0xff) # IPv4: A.B.C.0
313313
end
314314

315315
#

0 commit comments

Comments
 (0)