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.
Written by John Amicangelo
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#