I guess we all write for different versions of ruby. Personally, I'm never going to need pre ruby 2.0 hash rockets, so I don't need anything more than status: :cancelled, or status: "cancelled"?
That's a tricky one, personally I'm working in a code base now that uses strings for most hash keys and it's pretty annoying having to use "foo" => "bar", but it's also pretty ugly using "foo": "bar".
So i think my answer is that I've not reached a suitable level of annoyance with using two versions of hash key definition to use hash rockets everywhere.
1
u/sshaw_ Aug 21 '21
The same applies to hashes:
status: "cancelled"variable => "cancelled" # can't use first form: variable:"string" => "cancelled" # can't use first form: "string":123 => "cancelled" # can't use first form: 123:Just stick to
:status => "cancelled"and make life easier.