What's best way to bend a tube?

hi , I wonder what is the best way to bend a tube? Is it possible to rotate tube’s vertices. An example Can really help me figure it out.

I’d suggest making a skinned mesh with bones; then you can just rotate the bones and the tube will bend.