This delicious plant is looking at me and asking me to eat it. May I do so? And how do I know if the fruit are ripe? And will I be enormously injured if I accidentally touch a needle?
Looks like a barrel or maybe fishhook cactus; according to this https://wryheat.wordpress.com/2009/08/01/edible-desert-plants-barrel-cactus-fruit/#:~:text=Most%20cacti%20bloom%20in%20the,prickly%20pear%2C%20and%20barrel%20cactus., all cactus fruits are edible, but not all are palatable. The fruits on this one still look a little green, but you can try one if you like.
As for the spines, avoid stabbing yourself with them - it will be painful and may cause a nasty injury, though they are not actually poisonous.