Class: Bureaucrat::Fields::EmailField
- Inherits:
-
RegexField
- Object
- Field
- CharField
- RegexField
- Bureaucrat::Fields::EmailField
- Defined in:
- lib/bureaucrat/fields.rb
Constant Summary collapse
- EMAIL_RE =
Original from Django’s EmailField: email_re = re.compile(
r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*" # dot-atom r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-011\013\014\016-\177])*"' # quoted-string r')@(?:[A-Z0-9]+(?:-*[A-Z0-9]+)*\.)+[A-Z]{2,6}$', re.IGNORECASE) # domain
/(^[-!#\$%&'*+\/=?^_`{}|~0-9A-Z]+(\.[-!#\$%&'*+\/=?^_`{}|~0-9A-Z]+)*|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-011\013\014\016-\177])*")@(?:[A-Z0-9]+(?:-*[A-Z0-9]+)*\.)+[A-Z]{2,6}$/i
Instance Attribute Summary
Attributes inherited from CharField
Attributes inherited from Field
#error_messages, #help_text, #hidden_widget, #initial, #label, #required, #show_hidden_initial, #widget
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ EmailField
constructor
A new instance of EmailField.
Methods inherited from RegexField
Methods inherited from CharField
Methods inherited from Field
#clean, hidden_widget, inherited, #initialize_copy, set_error, #validating, widget, #widget_attrs
Methods included from Validation::Converters
to_big_decimal, to_bool, to_float, to_integer
Methods included from Validation::Validates
Methods included from Validation::Validators
empty_value?, has_max_decimal_places, has_max_digits, has_max_length, has_max_whole_digits, has_min_length, included_in, is_array, is_email, is_not_greater_than, is_not_lesser_than, is_present, is_true, matches_regex, not_empty
Constructor Details
#initialize(options = {}) ⇒ EmailField
Returns a new instance of EmailField.
287 288 289 |
# File 'lib/bureaucrat/fields.rb', line 287 def initialize(={}) super(EMAIL_RE, ) end |