Learing the template method of ruby