18 lines
349 B
Ruby
Executable File
18 lines
349 B
Ruby
Executable File
module Fiddle
|
|
class Closure
|
|
attr_reader :ctype
|
|
attr_reader :args
|
|
|
|
class BlockCaller < Fiddle::Closure
|
|
def initialize ctype, args, abi = Fiddle::Function::DEFAULT, &block
|
|
super(ctype, args, abi)
|
|
@block = block
|
|
end
|
|
|
|
def call *args
|
|
@block.call(*args)
|
|
end
|
|
end
|
|
end
|
|
end
|