class ActiveLdap::Schema::Syntaxes::OtherMailbox

Private Instance Methods

validate_normalized_value(value, original_value) click to toggle source
# File lib/active_ldap/schema/syntaxes.rb, line 357
def validate_normalized_value(value, original_value)
  type, mailbox = value.split('$', 2)

  if type.empty?
    return _("%s has no mailbox type") % original_value.inspect
  end

  if /(#{UNPRINTABLE_CHARACTER})/ =~ type
    format = _("%s has unprintable character in mailbox type: '%s'")
    return format % [original_value.inspect, $1]
  end

  if mailbox.blank?
    return _("%s has no mailbox") % original_value.inspect
  end

  nil
end