Stack approach to Command Pattern in Ruby