Class: XboxLiveValidator

Inherits:
AccountNameValidator show all
Defined in:
lib/xbox_live_validator.rb

Overview

Validates Xbox Live gamertags. From the Xbox Live website:

Gamertags can only contain letters, numbers, and spaces, and can't begin with a number.

Xbox gamertags are 3-12 characters and cannot start with a space.

The following error message keys are used to localize invalid screen names.

| | | |:--------------------------|:--------------------------------------| | xbox_too_short | Gamertag is under 3 characters. | | xbox_too_long | Gamertag is over 12 characters. | | xbox_invalid_chars | Gamertag contains invalid characters. | | xbox_invalid_first_char | Gamertag doesn't start with a letter. |

Options

| | | |:-------------|:-------------------------------------------------| | :message | A custom message to use if the email is invalid. | | :allow_nil | If true, nil values are allowed. |

Examples:

validates :steam_account, steam: true

Method Summary

Methods inherited from AccountNameValidator

add_validation, error_key_prefix, first_char, max_length, min_length, valid_chars, #validate_each