Module: Mount::C::Bool

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

Class Method Summary collapse

Class Method Details

.from_native(value, ctx) ⇒ Object



77
78
79
# File 'lib/rbmount/c.rb', line 77

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

.to_native(value, ctx) ⇒ Object



73
74
75
# File 'lib/rbmount/c.rb', line 73

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