Sha256: 2d0913538387c4573959c7653ac6431e353d4f0cc767b3f2782a369774dfefbb
Contents?: true
Size: 377 Bytes
Versions: 24
Compression:
Stored size: 377 Bytes
Contents
module MonkeyPatch module Integer # Defines Integer#nbit? methods. module Ranges def unsigned_8bit? _within_range? 8 end def unsigned_16bit? _within_range? 16 end def unsigned_32bit? _within_range? 32 end def _within_range?(nbit) (0 <= self) && (self < 2**nbit) end end end end
Version data entries
24 entries across 24 versions & 1 rubygems