Module: Xot::BitUtil

Included in:
BitFlag
Defined in:
lib/xot/bit_util.rb

Class Method Summary collapse

Class Method Details

.bit(*bits) ⇒ Object



11
12
13
14
# File 'lib/xot/bit_util.rb', line 11

def bit (*bits)
  return nil if bits.compact.empty?
  bits.reduce(0) {|value, nth| value | (0x1 << nth)}
end