Last Updated: February 25, 2016
·
591
· johnamican

Prettier passing of options in Ruby

Given a method hello that accepts an options hash...

Instead of this:

hello({
  foo: :bar,
  biz: :baz,
  bic: {
    buc: :boo
  }
})

Try this!

hello \
  foo: :bar,
  biz: :baz,
  bic: {
    buc: :boo
  }

A little bit cleaner imo.