def extend_nonlocals(bind)
      bind.eval('instance_variables').each do |var|
        @binding.eval('self').instance_variable_set var, bind.eval(var.to_s)
      end

      bind.eval('self.class.class_variables').each do |var|
        @binding.eval('self').class_variable_set var, bind.eval(var.to_s)
      end
    end
def extend_nonlocals(bind)
      bind.eval('instance_variables').each do |var|
        @binding.eval('self').instance_variable_set var, bind.eval(var.to_s)
      end

      bind.eval('self.class.class_variables').each do |var|
        @binding.eval('self').class_variable_set var, bind.eval(var.to_s)
      end
    end
Extend instance, class and global variables for use in definitions

 @param bind [Binding] Binding to extend current context binding