RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

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

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in