Sha256: 5bb3f738b6383bcdd84999b1a827b504860f829bd878f71f58f6dd0890c36dd8

Contents?: true

Size: 229 Bytes

Versions: 13

Compression:

Stored size: 229 Bytes

Contents

# -*- coding: utf-8 -*-


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

13 entries across 13 versions & 1 rubygems

Version Path
xot-0.1.34 lib/xot/bit_util.rb
xot-0.1.33 lib/xot/bit_util.rb
xot-0.1.32 lib/xot/bit_util.rb
xot-0.1.31 lib/xot/bit_util.rb
xot-0.1.30 lib/xot/bit_util.rb
xot-0.1.29 lib/xot/bit_util.rb
xot-0.1.28 lib/xot/bit_util.rb
xot-0.1.27 lib/xot/bit_util.rb
xot-0.1.26 lib/xot/bit_util.rb
xot-0.1.25 lib/xot/bit_util.rb
xot-0.1.24 lib/xot/bit_util.rb
xot-0.1.23 lib/xot/bit_util.rb
xot-0.1.22 lib/xot/bit_util.rb