local class = select(2, UnitClass(name))
String - the unitId to query, e.g. "player"
As returned by UnitName, GetGuildRosterInfo, GetFriendInfo, COMBAT LOG EVENT, etc. This must be spelled exactly and will be invalid if the named player is not a part of your party or raid. As with all other UnitIDs, it is not case sensitive.