Weird chord implementation in the Ruby language