I often find myself checking if some value belongs to some set. As I understand, people normally use Enumerable#member? for this.
Enumerable#member?
end_index = [\
In your specific case there's end_with?, which takes multiple arguments.
"Hello.".end_with?(',', '.') #=> true