Sums of some array elements
Ruby can be an extremely concise language, where your programs are almost already written for you:

def sum(array)
    array.inject(0, :+)
end


Where the docs say:


  inject { |memo, obj| block } → obj
  
  Combines all elements of enum by applying a binary operation,
  specified by a block or a symbol that names a method or operator.


In fact reading the docs can go a long way in shortening your programs.



Reading the docs for Array tells us that sorting is built-in and last (the twin of first) are too, also, we just wrote a handy sum function.

def max_2_sum(array)
    sum(array.sort.last(2))
end


This is slower than needed, that is O log n instead of O n but it may be optimized iff it becomes a performance bottleneck (improbable).



Your last function is indeed nice, but the assignment was not necessary and you did not use the handy built-in any?

def sum_to_n?(array, val)
    array.product(array).any? {|couple| sum(couple) == val}
end