Dear Reader,
It’s quite amazing to me today that when i was reading Delegates concept in Ruby. The Syntax, and working(execution style) is almost similar i can say. I guess this is one of those situations you might say for yourself AHA!
I am very well versed and used many times delegates in C# and so when i started the topic of similar in Ruby today i was quite amazed to learn that it almost looks similar and if your like me, will surely fall in love with ruby as you did with C#.
Of course this post is not about C# vs Ruby. It’s about those similarities which benefits and surprises developers like me who wish to earn different languages all together.
So just to give you the big picture, here is the below code:
prc = lambda {puts 'Hello'}
# method call invokes the block
prc.call
As you can see above, this almost looks the same as the C# equivalent of anonymous delegates which is as shown below:
Action myDel = () => Console.WriteLine("Hello");
myDel();
That’s all my friend, i just wanted to share my AHA surprise moments with you. Hope you liked it.
As always, your valuable comments are much appreciated and helpful for my learning.
Thanks,
Happy Coding

