hdb55w
Last Updated: February 25, 2016
·
455
· johnamican
4194545523e30716c56abbe77c264aac

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.

Say Thanks
Respond