There currently is no ransomware that can affect a Mac that works in the way CryptoLocker and other such software that plagues Windows.
In Windows, your data is literally encrypted by malware that automatically gets on your system (the way a lot of such malware does in Windows) when visiting a web site purposely set up to do just that, or an email attachment that gets the malware download started when you open it. They only way to get your data back, other than from a recent backup, is to pay the ransom fee to get the decryption key.
In OS X, the best the crooks have been able to come up with is a JavaScript trick. When you hit one of these pages, it shows a popup that makes some sort of claim your computer is infected. Many times, with complete nonsense text that your "Windows" OS is infected (you're not running Windows), "Norton Anti-Virus" has detected xxx (you don't even have Norton AV installed), "Windows Defender" has detected xxx (again, impossible to have Windows only software running on your Mac), and other giveaway's that scream "scam".
For all of these scam sites, your Mac has not been infected with anything. Period. Nothing has even been downloaded to your Mac. It's just a matter of clearing the page Safari is locked to by the JavaScript loop.