summaryrefslogtreecommitdiff
path: root/ext/fiddle/lib/fiddle/import.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fiddle/lib/fiddle/import.rb')
-rw-r--r--ext/fiddle/lib/fiddle/import.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/fiddle/lib/fiddle/import.rb b/ext/fiddle/lib/fiddle/import.rb
index faf7cb3..75853d6 100644
--- a/ext/fiddle/lib/fiddle/import.rb
+++ b/ext/fiddle/lib/fiddle/import.rb
@@ -290,9 +290,8 @@ module Fiddle
if( !addr )
raise(DLError, "cannot find the function: #{name}()")
end
- f = Function.new(addr, argtype, ctype, CALL_TYPE_TO_ABI[call_type])
- f.instance_eval { @name = name }
- f
+ Function.new(addr, argtype, ctype, CALL_TYPE_TO_ABI[call_type],
+ name: name)
end
# Returns a new closure wrapper for the +name+ function.
@@ -309,9 +308,7 @@ module Fiddle
define_method(:call, block)
}.new(ctype, argtype, abi)
- f = Function.new(closure, argtype, ctype, abi)
- f.instance_eval { @name = name }
- f
+ Function.new(closure, argtype, ctype, abi, name: name)
end
end
end