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