Class ActiveLdap::Schema::Syntax
In: lib/active_ldap/schema.rb
Parent: Entry
Error AttributeAssignmentError AdapterNotSpecified OperationNotPermitted RequiredObjectClassMissed ConnectionError RequiredAttributeMissed LdifInvalid DistinguishedNameNotSetError EntryNotFound LdapError SaveError StrongAuthenticationRequired AdapterNotFound ConnectionNotEstablished TimeoutError AuthenticationError AttributeValueInvalid EntryNotSaved DistinguishedNameInputInvalid EntryAlreadyExist ObjectClassError UnknownAttribute EntryInvalid DeleteError ConfigurationError DistinguishedNameInvalid Base DistinguishedName Reloadable::Deprecated Reloadable::Subclasses Enumerable Ldif Collection EntryAttribute StandardError Children HasMany HasManyWrap BelongsToMany Proxy BelongsTo Common Find LDIF Delete Update Normalizable 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 Schema\n[lib/active_ldap/schema.rb\nlib/active_ldap/schema/syntaxes.rb] JndiConnection lib/active_ldap/distinguished_name.rb lib/active_ldap/base.rb lib/active_ldap/schema.rb lib/active_ldap/entry_attribute.rb lib/active_ldap/ldif.rb lib/active_ldap/ldap_error.rb ClassMethods Associations LdapBenchmarking ActionController ClassMethods Tree Acts Populate 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 Command Update Common ModifyNameRecordLoadable AddOperationModifiable DeleteOperationModifiable ReplaceOperationModifiable ModifyRecordLoadable DeleteRecordLoadable AddRecordLoadable ContentRecordLoadable LDIF Delete Find Operations ClassMethods Normalizable Attributes GetTextSupport Escape ClassMethods Configuration ClassMethods ObjectClass lib/active_ldap/get_text/parser.rb GetText ClassMethods Callbacks 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 ClassMethods Connection Salt UserPassword ActiveLdap dot/m_44_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]