Class ActiveLdap::Schema::Syntaxes::BitString
In: lib/active_ldap/schema/syntaxes.rb
Parent: Base
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

Public Instance methods

[Source]

    # File lib/active_ldap/schema/syntaxes.rb, line 52
52:         def normalize_value(value)
53:           if value.is_a?(String) and /\A[01]*\z/ =~ value
54:             "'#{value}'B"
55:           else
56:             value
57:           end
58:         end

[Source]

    # File lib/active_ldap/schema/syntaxes.rb, line 43
43:         def type_cast(value)
44:           return nil if value.nil?
45:           if /\A'([01]*)'B\z/ =~ value.to_s
46:             $1
47:           else
48:             value
49:           end
50:         end

Private Instance methods

[Source]

    # File lib/active_ldap/schema/syntaxes.rb, line 61
61:         def validate_normalized_value(value, original_value)
62:           if /\A'/ !~ value
63:             return _("%s doesn't have the first \"'\"") % original_value.inspect
64:           end
65: 
66:           if /'B\z/ !~ value
67:             return _("%s doesn't have the last \"'B\"") % original_value.inspect
68:           end
69: 
70:           if /([^01])/ =~ value[1..-3]
71:             return _("%s has invalid character '%s'") % [value.inspect, $1]
72:           end
73: 
74:           nil
75:         end

[Validate]