class ABC に
@cost1
@cost2
@cost3
@cost4
というアクセサつきのインスタンスがあったとして

def test(index)
x = ABC.new
case index
when 1
return x.cost1
when 2
return x.cost2
when 3
return x.cost3
when 4
return x.cost4
end
end
これのcostの後ろの数字をindexを参照してreturnしたいのですが
具体的にどう書けばいいのでしょうか?
return x.cost + index.to_s ????