module KernelAs you can see, insstance_eval can be used like JavaScript or VB's with. This is nice for the simple reason of documentation. I find this usage much easier to read and understand than most usages of instance_eval that I've seen.
def with(obj = nil, &block)
(obj || self).instance_eval &block
end
end
with("abc") do
puts reverse
end
"abc".with do
puts reverse
end
So, that's it for today. I'll probably be back soon with some recent JRuby developments too.