Class: ActiveLdap::Schema::Syntaxes::DistinguishedName — activeldap - ActiveLdap

Class: ActiveLdap::Schema::Syntaxes::DistinguishedName

Inherits:
Base
  • Object
show all
Defined in:
lib/active_ldap/schema/syntaxes.rb

Constant Summary

Constant Summary

Constants inherited from Base

Base::PRINTABLE_CHARACTER, Base::SYNTAXES, Base::UNPRINTABLE_CHARACTER

Instance Method Summary (collapse)

Methods inherited from Base

#binary?, #valid?, #validate

Instance Method Details

- (Object) normalize_value(value)



141
142
143
144
145
146
147
# File 'lib/active_ldap/schema/syntaxes.rb', line 141

def normalize_value(value)
  if value.is_a?(DN)
    value.to_s
  else
    value
  end
end

- (Object) type_cast(value)



134
135
136
137
138
139
# File 'lib/active_ldap/schema/syntaxes.rb', line 134

def type_cast(value)
  return nil if value.nil?
  DN.parse(value)
rescue DistinguishedNameInvalid
  value
end