   validateEmail: () ->
     User.validateEmail @email
 
+  ### Static Methods ###
 
-  # Static validators
-  # -----------------
+  #### Static Validators ####
 
   # In addition to validated user instances, static validators are available.
   # Each throws an error on failure describing the problem, or returns true:

  #       isValid = user.validateUsername()
  #     catch validationErr
  #       message = validationErr.message
  #
  validateUsername: () ->
    User.validateUsername @username

Base = require '../argumenta/base'
Auth = require '../argumenta/auth'

#
# User models a user account.
#
class User extends Base

  ### Errors ###

  Error: @Error = @Errors.User
  ValidationError: @ValidationError = @Errors.Validation

  ### Constructor ###

  # Creates a user instance.
  #
  #     user = new User
  #       username:      'demosthenes'
  #       email:         'demos@athens.net'
  #       password_hash: '$2a$12$6nZyzVgeCmBK9JkZb9rNG.9s/d/i/g2Tbyf4vk318XQLQKi4GXXZ2'
  #
  # @api public
  # @see Users#create()
  # @param [Object] params A hash of user params.
  # @param [String] params.username The user's login name.
  # @param [String] params.email    The user's email adress.
  # @param [String] params.password_hash The user's password hash.
  constructor: (params) ->
    @username      = params.username
    @email         = params.email
    @password_hash = params.password_hash

  ### Instance Methods ###

  #### Validation ####

  # Validates a user instance.
  #
  #     isValid = user.validate()
  #
