module GirFFI::EnumLikeBase
Base module for enums and flags.
Public Instance Methods
Source
# File lib/gir_ffi/enum_like_base.rb, line 25 def copy_value_to_pointer(value, pointer, offset = 0) pointer.put_int32 offset, to_native(value, nil) end
Source
# File lib/gir_ffi/enum_like_base.rb, line 29 def get_value_from_pointer(pointer, offset) from_native pointer.get_int32(offset), nil end
Source
# File lib/gir_ffi/enum_like_base.rb, line 33 def setup_and_call(method, arguments, &) result = setup_method method.to_s raise "Unable to set up method #{method} in #{self}" unless result send(method, *arguments, &) end
Source
# File lib/gir_ffi/enum_like_base.rb, line 45 def to_callback_ffi_type :int32 end
Source
# File lib/gir_ffi/enum_like_base.rb, line 17 def to_int(arg) to_native arg, nil end
Source
# File lib/gir_ffi/enum_like_base.rb, line 13 def wrap(arg) from_native arg, nil end