 		# make it node compatible
 		clazz.super_ = Enum
 
+		# Returns the constant for either name or ordinal.
+		#
+		# @throws TypeError in case that the value does not match any one of the ordinals or names (case sensitive)
+		# @return enum constant
 		clazz.valueOf = (value) ->
 			throw new TypeError("'#{value}' is not a constant of this.") unless value in dict
 			dict[value] if value in dict
 
+		# Returns the enum constants.
+		#
+		# @return array containing the enum constants defined by the enum class.
 		clazz.values = () ->
 			value for value in values
 



class Enum
	constructor: () ->
		throw new TypeError("enums cannot be instantiated nor derived from."); 

	name: () ->
		return @_name

	ordinal: () ->
		return @_ordinal

	valueOf: () ->
		return @_ordinal


Enum.create = (decl) ->
	oargs = arguments
	_ = ->

		if values.length == 0
			throw new TypeError("Enums require at least one literal constant.");

		# prevent derivation and instantiation of the enum class
		finalized = true;

		clazz
		
	_()

