json is not an external gem package but built-in
indentation. see also: http://shugo.net/ruby-codeconv/codeconv.html
the locations of colons weren't aligned
use suffix if to follow convention
be more declarative
avoid duplicate
suffix if for same reason
if-elsif-else repeats -> case/when
no need for explicit return
cosmetic change
avoid legacy notation
follows convention
ditto