[@item.type, @item == @sortcol && [:sort, @sortdir]]
=>
# if @item.type is blank, so class is still empty
# if @item.type is "numeric" class is "numeric"
class = @item.type
# if @item equal @sortcol
# class will append "sort" and @sortdir if it is not empty.
if @item == @sortcol
class += "sort"
class += @sortdir
end
Эта конструкция @item == @sortcol && [:sort, @sortdir]
будет возвращать [: sort, @sortdir], только если @item == @sortcol
имеет значение true