Bind a block to a method : binding « Method « Ruby






Bind a block to a method


def aMethod
  return binding
end

the_binding = aMethod { puts "hello" }
eval "yield", the_binding                # hello

 








Related examples in the same category

1.Return a binding