You could also try x.to_int + y.to_int and use respond_to?(:to_int)
for detection. Equally with #to_ary. Duck typing!