RF PCB Design Basics

What is the purpose of the golden ring around the PCB, often seen on RF designs, like this?

bare PCB

I suppose it is used as some kind of shield. But, what is it protecting - the board from the external EM sources or the environment from the board's EM radiation? Why is it golden and not masked (painted)? Are there some rules for designing such rings (e.g. ring width, shape, via mechanics, ...)? And, finally, in some cases, there are rings that are not completely golden, like around the CC3200 in the following image below. What is the difference?

TI CC3200 Launchpad PCB