I remember my dad telling me about when he was a machinist in the Navy during the 50s and he would make something similar. It was basically a pen shaped zip gun. Unscrew and put in a 22LR and screw back together. The firing pin was held back by a very strong spring that you would pull back and slip to the side. To fire, you had to pull back over the "safety notch", slide to the right and just let go and BANG. Apparently these were for sailors on shore leave in case they got into a jam and could be easily disposed of.