Sha256: 44b885f054999350e8205fc06e61070ee416f49114da144e190a81b83c9664bd

Contents?: true

Size: 203 Bytes

Versions: 11

Compression:

Stored size: 203 Bytes

Contents

module Xot


  module BitUtil

    module_function

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

  end# BitUtil


end# Xot

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
xot-0.3 lib/xot/bit_util.rb
xot-0.2.1 lib/xot/bit_util.rb
xot-0.2 lib/xot/bit_util.rb
xot-0.1.42 lib/xot/bit_util.rb
xot-0.1.41 lib/xot/bit_util.rb
xot-0.1.40 lib/xot/bit_util.rb
xot-0.1.39 lib/xot/bit_util.rb
xot-0.1.38 lib/xot/bit_util.rb
xot-0.1.37 lib/xot/bit_util.rb
xot-0.1.36 lib/xot/bit_util.rb
xot-0.1.35 lib/xot/bit_util.rb