# frozen_string_literal: true # Un campo de correo class MetadataEmail < MetadataString # Aplica distintas validaciones a la cuenta de correo # # @return [Boolean] def validate super errors << email_address.error.capitalize unless email_address.valid? errors.empty? end private # @return [EmailAddress::Address] def email_address @email_address ||= EmailAddress::Address.new(value, {}, I18n.locale.to_s) end end