Class ActiveLdap::Schema::Syntax
In: lib/active_ldap/schema.rb
Parent: Entry
Error DeleteError LdapError AdapterNotSpecified OperationNotPermitted RequiredAttributeMissed LdifInvalid AttributeAssignmentError RequiredObjectClassMissed DistinguishedNameNotSetError StrongAuthenticationRequired ConnectionError SaveError EntryNotFound AuthenticationError EntryNotSaved UnknownAttribute ConnectionNotEstablished TimeoutError ConfigurationError AdapterNotFound DistinguishedNameInvalid ObjectClassError EntryInvalid EntryAlreadyExist Base DistinguishedName Ldif Reloadable::Deprecated Reloadable::Subclasses Enumerable Collection StandardError Children HasMany HasManyWrap BelongsToMany Proxy BelongsTo Common Find LDIF Delete Update GetText Parser GetTextSupport Base\n[lib/active_ldap/adapter/base.rb\nlib/active_ldap/adapter/ldap.rb\nlib/active_ldap/adapter/net_ldap.rb] Ldap NetLdap Normalize ActiveRecord::Callbacks ActiveRecord::Validations Schema\n[lib/active_ldap/schema.rb\nlib/active_ldap/schema/syntaxes.rb] lib/active_ldap/base.rb lib/active_ldap/schema.rb lib/active_ldap/ldif.rb lib/active_ldap/distinguished_name.rb lib/active_ldap/ldap_error.rb ClassMethods Associations ClassMethods HumanReadable lib/active_ldap/association/has_many_wrap.rb lib/active_ldap/association/has_many.rb lib/active_ldap/association/proxy.rb lib/active_ldap/association/children.rb lib/active_ldap/association/collection.rb lib/active_ldap/association/belongs_to_many.rb lib/active_ldap/association/belongs_to.rb HasManyUtils Association ClassMethods Tree Acts Common LDIF Delete Find Update Operations lib/active_ldap/get_text/parser.rb GetText ClassMethods Configuration Command lib/active_ldap/adapter/net_ldap.rb lib/active_ldap/adapter/ldap.rb Adapter GetTextSupport Normalize ClassMethods Attributes Escape Callbacks ClassMethods ObjectClass Helper Validations ClassMethods Connection GetTextFallback Populate Salt UserPassword ActiveLdap dot/m_40_0.png

Methods

Attributes

length  [R] 

Public Class methods

[Source]

     # File lib/active_ldap/schema.rb, line 281
281:       def initialize(id, schema)
282:         if /\{(\d+)\}\z/ =~ id
283:           id = $PREMATCH
284:           @length = Integer($1)
285:         else
286:           @length = nil
287:         end
288:         super(id, schema, "ldapSyntaxes")
289:         @id = id
290:         @name = nil if @name == @id
291:         @validator = Syntaxes[@id]
292:       end

Public Instance methods

[Source]

     # File lib/active_ldap/schema.rb, line 330
330:       def <=>(other)
331:         id <=> other.id
332:       end

[Source]

     # File lib/active_ldap/schema.rb, line 294
294:       def binary_transfer_required?
295:         @binary_transfer_required
296:       end

[Source]

     # File lib/active_ldap/schema.rb, line 298
298:       def human_readable?
299:         @human_readable
300:       end

[Source]

     # File lib/active_ldap/schema.rb, line 322
322:       def normalize_value(value)
323:         if @validator
324:           @validator.normalize_value(value)
325:         else
326:           value
327:         end
328:       end

[Source]

     # File lib/active_ldap/schema.rb, line 334
334:       def to_param
335:         id
336:       end

[Source]

     # File lib/active_ldap/schema.rb, line 314
314:       def type_cast(value)
315:         if @validator
316:           @validator.type_cast(value)
317:         else
318:           value
319:         end
320:       end

[Source]

     # File lib/active_ldap/schema.rb, line 302
302:       def valid?(value)
303:         validate(value).nil?
304:       end

[Source]

     # File lib/active_ldap/schema.rb, line 306
306:       def validate(value)
307:         if @validator
308:           @validator.validate(value)
309:         else
310:           nil
311:         end
312:       end

Private Instance methods

[Source]

     # File lib/active_ldap/schema.rb, line 339
339:       def attribute(attribute_name, name=@name)
340:         @schema.ldap_syntax_attribute(name, attribute_name)
341:       end

[Source]

     # File lib/active_ldap/schema.rb, line 343
343:       def collect_info
344:         @description = attribute("DESC")[0]
345:         @binary_transfer_required =
346:           (attribute('X-BINARY-TRANSFER-REQUIRED')[0] == 'TRUE')
347:         @human_readable = (attribute('X-NOT-HUMAN-READABLE')[0] != 'TRUE')
348:       end

[Validate]