Artist Constantine Zlatez and Kostadin Ilov, a computer scientist at UC Berkeley, put a decommissioned lever-action rifle to good use, dispensing candy for all to enjoy. They use plastic capsules similar in shape to ammo. Probably .30-30 Winchester.
You insert a brass disc like a coin and the machine is activated. A motor actuates the lever action and ejects the capsule of candy. The candy capsule is caught in the metal mesh basket below the rifle’s action. Then it tumbles into a tray for you to retrieve your candy.
I do not like the fact that you are facing the muzzle as you insert the coin. I realize it is an art piece an often artists make guns into art as some anti-gun statement. I can’t tell if that is the case here but it is a pretty cool set up.