Method: BitMagic::BitField#read_field
- Defined in:
- lib/bit_magic/bit_field.rb
#read_field(*args) ⇒ Integer Also known as: []
Read the specified bit indices as a group, in the order given
52 53 54 55 56 57 58 59 60 |
# File 'lib/bit_magic/bit_field.rb', line 52 def read_field(*args) m = 0 args.flatten.each_with_index do |bit, i| if bit.is_a?(Integer) m |= ((@value[bit] || 0) << i) end end m end |