Code, Creativity & Community
Showing posts tagged Ruby · View all posts
Editor's pick
Ruby's .map(&:to_s) syntax looks cryptic at first. It's syntactic sugar for passing blocks to methods, converting symbols to procs automatically. Understanding it makes Ruby code more concise and idiomatic.
Read more...
Ruby's Symbol-to-Proc: Understanding .map(&:to_s) Syntax
Ruby Blocks Explained: Understanding {|x| x * x} Syntax
Ruby's rescue nil: Exception Handling Shorthand (And Why to Avoid It)