Code Smells And Ruby Shorthand: Unpacking Ampersand + to_proc
One of the worst code smells – and a sign that it’s time to refactor – is long methods. Thankfully, Ruby has some pretty cool shorthands that’ll have you replacing lines in no time! This blog post explores the “ampersand and object” (&:) syntax and unpacks how it uses to_proc to make your iterations even simpler!
Post a comment