various approaches in ruby