Module: Xot::BitUtil
- Included in:
- BitFlag
- Defined in:
- lib/xot/bit_util.rb
Class Method Summary collapse
Class Method Details
.bit(*bits) ⇒ Object
8 9 10 11 |
# File 'lib/xot/bit_util.rb', line 8 def bit(*bits) return nil if bits.compact.empty? bits.reduce(0) {|value, nth| value | (0x1 << nth)} end |