Module: BlkID::C::BlkIDBool

Extended by:
FFI::DataConverter
Defined in:
lib/rblkid/c/types.rb

Class Method Summary collapse

Class Method Details

.from_native(value, ctx) ⇒ Object



45
46
47
# File 'lib/rblkid/c/types.rb', line 45

def self.from_native (value, ctx)
  value.zero?
end

.to_native(value, ctx) ⇒ Object



41
42
43
# File 'lib/rblkid/c/types.rb', line 41

def self.to_native (value, ctx)
  [0, false, nil].include?(value) ? 1 : 0
end