Method: CTypes::Bitmap#permissive

Defined in:
lib/ctypes/bitmap.rb

#permissiveBitmap

get a permissive version of this bitmap

Examples:

b = CTypes::Helpers.bitmap(uint8, {a: 0})
b.unpack("\x04")                  # => Dry::Types::ConstraintError

b = CTypes::Helpers.bitmap(uint8, {a: 0}).permissive
b.unpack("\x04")                  # => [:bit_2]

Returns:

  • (Bitmap)

    permissive version of the bitmap.



150
151
152
# File 'lib/ctypes/bitmap.rb', line 150

def permissive
  Bitmap.new(type: @type, bits: @bits.permissive)
end