Some Ruby code to demonstrate the use of the State Pattern