Paul
Groves
Ltd

One liner to create and use variable

Just something tiny I picked up which allows you to operate on a variable in one line, without having to define it first in a separate line, so instead of…

@things ||= []
@things << 'foo'

You can use parenthesis to achieve the same thing…

(@things ||= []) << 'foo'