Fix syntax warning in Ruby 2.2

warning: possible reference to past scope - contest