/IronPython_Main/External.LCA_RESTRICTED/Languages/Ruby/redist-libs/ruby/1.9.1/fiddle/closure.rb
Ruby | 17 lines | 15 code | 2 blank | 0 comment | 0 complexity | 65abb5d7ffb49312130f64643e8c9646 MD5 | raw file
Possible License(s): GPL-2.0, MPL-2.0-no-copyleft-exception, CPL-1.0, CC-BY-SA-3.0, BSD-3-Clause, ISC, AGPL-3.0, LGPL-2.1, Apache-2.0
- 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