For the ternaries, you can just index into the value, it'll return nil if the key doesn't exist:

:url => person["url"]