API:UnitClass

Get the classes of a unit.
UnitClass("player")
== Parameter ==
:;unit
::String - the UnitID (e.g. "target", "party1", "raid1", etc..) 
== Returns ==
:;class
::String - current main class of the specified unit. Returns nil if the specified unit does not exist (eg. "target" given but there is no target).
:;class
::String - current secondary class of the specified unit. Returns nil if the specified unit does not exist; Returns the empty string if specified unit has no second class.
== Example ==
Store your classes to a table.
g_myclasses = {UnitClass("player")}
UnitClass