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!

Ruby's New &.!= Operator

Well, it’s actually two operators. Sue me. The 2.3.0 release of Ruby included the safe navigation operator, &.. It does the same thing as try! in Rails. You can chain method calls together and bail early if you hit a nil. In Ruby some things you don’t normally think of as method calls are in fact just that. For example, operators like !=.

Read more: http://aaronlasseigne.com/2016/01/04/rubys-new-safe-navigation-not-equal-operator/

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