See the discussion here: eigenclass.org/hiki.rb?instance_exec about implementations of the ruby 1.9 method instance_exec(). This version is the one from Rails. It isn’t thread safe, but that doesn’t matter for the intended use in invoking blocks as Qt slots.
Source Code
# File qt/qtruby4.rb, line 2661 def instance_exec(*arguments, &block) block.bind(self)[*arguments] end
<code/>and<pre/>for code samples.