Scan array for 3 consecutive numbers that sum to 7
Your code, is way too imperative to be idiomatic Ruby.

The only reasonable improvement is re-writing it from scratch:

def lucky_sevens?(numbers)
  groups_of_three(numbers)
    .any? {|group| group.inject(:+) == 7}
end


Knowing that inject(:+) means sum, this reads like English. Implementing groups_of_three is left as an exercise for the reader.