homework for Ruby class