lib/ffi/stat_vfs.rb in ffi-libfuse-0.4.0 vs lib/ffi/stat_vfs.rb in ffi-libfuse-0.4.1
- old
+ new
@@ -73,11 +73,10 @@
# @return [Integer] Mount flags
# @!attribute [rw] namemax
# @return [Integer] Maximum filename length
- int_members = members.grep(/^f_/).map { |m| m[2..].to_sym }
- ffi_attr_accessor(*int_members, format: 'f_%s')
+ ffi_attr_accessor(**members.grep(/^f_/).to_h { |m| [m[2..].to_sym, m] })
extend FFI::Library
ffi_lib FFI::Library::LIBC
attach_function :native_statvfs, :statvfs, [:string, by_ref], :int