Class ActiveLdap::Schema::Syntax
In: lib/active_ldap/schema.rb
Parent: Entry
Error AttributeAssignmentError AdapterNotSpecified OperationNotPermitted RequiredObjectClassMissed ConnectionError RequiredAttributeMissed LdifInvalid LdapError DistinguishedNameNotSetError EntryNotFound SaveError StrongAuthenticationRequired NotImplemented AdapterNotFound TimeoutError AuthenticationError AttributeValueInvalid EntryNotSaved DistinguishedNameInputInvalid EntryAlreadyExist ObjectClassError UnknownAttribute EntryInvalid DeleteError ConfigurationError ConnectionNotSetup DistinguishedNameInvalid Schema\n[lib/active_ldap/schema.rb\nlib/active_ldap/schema/syntaxes.rb] Base DistinguishedName Reloadable::Deprecated Reloadable::Subclasses Enumerable Ldif Collection EntryAttribute StandardError Children HasMany HasManyWrap BelongsToMany Proxy BelongsTo Normalizable Common Find LDIF Delete Update GetText Parser ActiveRecord::Callbacks ActiveRecord::Validations Base\n[lib/active_ldap/adapter/base.rb\nlib/active_ldap/adapter/jndi.rb\nlib/active_ldap/adapter/ldap.rb\nlib/active_ldap/adapter/net_ldap.rb] Jndi Ldap NetLdap GetTextSupport Xml JndiConnection lib/active_ldap/distinguished_name.rb lib/active_ldap/base.rb lib/active_ldap/xml.rb lib/active_ldap/schema.rb lib/active_ldap/entry_attribute.rb lib/active_ldap/ldif.rb lib/active_ldap/ldap_error.rb LdapBenchmarking ActionController ClassMethods Associations Compatible ClassMethods Tree Acts lib/active_ldap/association/has_many_wrap.rb lib/active_ldap/association/children.rb lib/active_ldap/association/collection.rb lib/active_ldap/association/proxy.rb lib/active_ldap/association/belongs_to_many.rb lib/active_ldap/association/belongs_to.rb lib/active_ldap/association/has_many.rb HasManyUtils Association Populate Command ClassMethods Normalizable Attributes Escape GetTextSupport Update Common ModifyNameRecordLoadable AddOperationModifiable DeleteOperationModifiable ReplaceOperationModifiable ModifyRecordLoadable DeleteRecordLoadable AddRecordLoadable ContentRecordLoadable LDIF Delete Find Operations ClassMethods Configuration lib/active_ldap/get_text/parser.rb GetText ClassMethods Callbacks ClassMethods ObjectClass Validations lib/active_ldap/adapter/jndi_connection.rb lib/active_ldap/adapter/net_ldap.rb lib/active_ldap/adapter/ldap.rb lib/active_ldap/adapter/base.rb lib/active_ldap/adapter/jndi.rb Adapter Helper GetTextFallback ClassMethods HumanReadable Salt UserPassword ClassMethods Connection ActiveLdap dot/m_45_0.png

Methods

Attributes

length  [R] 

Public Class methods

[Source]

     # File lib/active_ldap/schema.rb, line 315
315:       def initialize(id, schema)
316:         if /\{(\d+)\}\z/ =~ id
317:           id = $PREMATCH
318:           @length = Integer($1)
319:         else
320:           @length = nil
321:         end
322:         super(id, schema, "ldapSyntaxes")
323:         @id = id
324:         @name = nil if @name == @id
325:         @validator = Syntaxes[@id]
326:       end

Public Instance methods

[Source]

     # File lib/active_ldap/schema.rb, line 364
364:       def <=>(other)
365:         id <=> other.id
366:       end

[Source]

     # File lib/active_ldap/schema.rb, line 328
328:       def binary_transfer_required?
329:         @binary_transfer_required
330:       end

[Source]

     # File lib/active_ldap/schema.rb, line 332
332:       def human_readable?
333:         @human_readable
334:       end

[Source]

     # File lib/active_ldap/schema.rb, line 356
356:       def normalize_value(value)
357:         if @validator
358:           @validator.normalize_value(value)
359:         else
360:           value
361:         end
362:       end

[Source]

     # File lib/active_ldap/schema.rb, line 368
368:       def to_param
369:         id
370:       end

[Source]

     # File lib/active_ldap/schema.rb, line 348
348:       def type_cast(value)
349:         if @validator
350:           @validator.type_cast(value)
351:         else
352:           value
353:         end
354:       end

[Source]

     # File lib/active_ldap/schema.rb, line 336
336:       def valid?(value)
337:         validate(value).nil?
338:       end

[Source]

     # File lib/active_ldap/schema.rb, line 340
340:       def validate(value)
341:         if @validator
342:           @validator.validate(value)
343:         else
344:           nil
345:         end
346:       end

Private Instance methods

[Source]

     # File lib/active_ldap/schema.rb, line 373
373:       def attribute(attribute_name, name=@name)
374:         @schema.ldap_syntax_attribute(name, attribute_name)
375:       end

[Source]

     # File lib/active_ldap/schema.rb, line 377
377:       def collect_info
378:         @description = attribute("DESC")[0]
379:         @binary_transfer_required =
380:           (attribute('X-BINARY-TRANSFER-REQUIRED')[0] == 'TRUE')
381:         @human_readable = (attribute('X-NOT-HUMAN-READABLE')[0] != 'TRUE')
382:       end

[Validate]