Rocking ratchets in nanostructured superconducting–magnetic hybrids