How can I animate the spin function?
Objects will rotate around their Origin Point. So, one simple way would be to move the objects Origin Point. Move the cursor to your desired axis then in “Object Mode” select the “Set Origin” drop down menu in the tool bar (Press T to toggle on and off) then select “Origin to 3D cursor”.

Another option would be to add an “Empty” to your desired axis and then parent the object Ctrl+P to the “Empty” and then rotate the empty.