PageRenderTime 38ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/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
  1. module Fiddle
  2. class Closure
  3. attr_reader :ctype
  4. attr_reader :args
  5. class BlockCaller < Fiddle::Closure
  6. def initialize ctype, args, abi = Fiddle::Function::DEFAULT, &block
  7. super(ctype, args, abi)
  8. @block = block
  9. end
  10. def call *args
  11. @block.call(*args)
  12. end
  13. end
  14. end
  15. end