Solving ruby warrior using the Command Pattern