These rings are diametrically magnetized, which means they are magnetized perpendicular to the axis of the hole. The poles are located on opposite sides of the circular faces, which makes them attract side-to-side as seen in the bottom picture. They can be placed on a shaft to work with sensors or to generate electricity.