There is, attach_variable
is what you're looking for.
This will work for anything that is actually a global variable (which looks to be your case) but not if the constants are just #define macros.
Quoting the FFI::Library
documentation for examples:
module Bar
extend FFI::Library
ffi_lib 'my_lib'
attach_variable :c_myvar, :myvar, :long
end
# now callable via Bar.c_myvar
and:
module Bar
extend FFI::Library
ffi_lib 'my_lib'
attach_variable :myvar, :long
end
# now callable via Bar.myvar