title: Is proc invocation stored in the class variable threadsafe?
body: <p>If I store block in controller's class variable and then invoke it from instances, does it cause any problem with thread scopes?
  Parameter which is passed to the block is local for each instance.</p>
  
  <p>Here is code example: </p>
  
  <pre><code>class BlockExecutor
    def initialize(&amp;block)
      self.instance_eval &amp;block
    end
    def sub_block(&amp;block)
      @block = block
    end
    def call(object)
      @block.call(object)
    end
  end
  
  module ClassDSL
    extend ActiveSupport::Concern
    module ClassMethods
      def define(&amp;block)
        @executor = BlockExecutor.new &amp;block
      end
  
      def execute_block(object)
        @executor.call(object)
      end
    end
  end
  
  class Controller
    include ClassDSL
  
    define do 
      sub_block do |object|
        # mutate object
      end
    end
  
    def run
      new_object = self.class.execute_block(object)
    end
  end
  </code></pre>