Marc Busqué

62 Followers
50 Following
19 Posts
Rubyist with a functional taste. Working at
remote.com. I love coding, traveling, and reading. Member of
@hanamirb and @dry_rb.
Quick quiz. Without trying it, what will this Ruby snippet return and why? #ruby 🙂
In #ruby the Method#to_proc conversion may initially seem comprehensive, but it's somewhat misleading. Unlike a dynamically bound Proc, a method-derived Proc maintains a fixed binding to its lexical scope. This distinction becomes apparent when attempting to execute a method within a different context, effectively challenging the versatility of instance_exec.
Ruby has a delightful knack for holding an additional secret. I recently learned that String#[] graciously accepts another String as an argument and returns it if the argument is found as a substring within the original one, or nil if it's not. This discovery came to light as I was processing a JSON String, initially mistaken for a Hash.🙂 #ruby