Ruby, three ways

Tried three ways to solve the problem in ruby for the sake of my own amusement.