Module ActiveLdap::Ldif::Attribute
In: lib/active_ldap/ldif.rb
Error AttributeAssignmentError AdapterNotSpecified OperationNotPermitted RequiredObjectClassMissed ConnectionError RequiredAttributeMissed LdifInvalid LdapError DistinguishedNameNotSetError EntryNotFound SaveError StrongAuthenticationRequired AdapterNotFound ConnectionNotEstablished TimeoutError AuthenticationError AttributeValueInvalid EntryNotSaved DistinguishedNameInputInvalid EntryAlreadyExist ObjectClassError UnknownAttribute EntryInvalid DeleteError ConfigurationError DistinguishedNameInvalid DistinguishedName Base Reloadable::Deprecated Reloadable::Subclasses Enumerable Ldif Collection EntryAttribute StandardError Children HasManyWrap HasMany 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 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 ClassMethods Tree Acts Command Update Common ModifyNameRecordLoadable AddOperationModifiable DeleteOperationModifiable ReplaceOperationModifiable ModifyRecordLoadable DeleteRecordLoadable AddRecordLoadable ContentRecordLoadable LDIF Delete Find Operations GetTextSupport Escape ClassMethods Normalizable Attributes 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/jndi.rb Adapter Helper GetTextFallback ClassMethods HumanReadable Salt UserPassword ClassMethods Connection ActiveLdap dot/m_44_0.png

Methods

Constants

SIZE = 75

Public Instance methods

[Source]

    # File lib/active_ldap/ldif.rb, line 34
34:       def encode(name, value)
35:         return "#{name}:\n" if value.blank?
36:         result = "#{name}:"
37: 
38:         if value[-1, 1] == ' ' or /\A#{Parser::SAFE_STRING}\z/u !~ value
39:           result << ":"
40:           value = [value].pack("m").gsub(/\n/u, '')
41:         end
42:         result << " "
43: 
44:         first_line_value_size = SIZE - result.size
45:         if value.size > first_line_value_size
46:           first_line_value = value[0, first_line_value_size]
47:           rest_value = value[first_line_value_size..-1]
48:         else
49:           first_line_value = value
50:           rest_value = nil
51:         end
52: 
53:         result << "#{first_line_value}\n"
54:         return result if rest_value.nil?
55: 
56:         rest_value.scan(/.{1,#{SIZE - 1}}/u).each do |line|
57:           result << " #{line}\n"
58:         end
59:         result
60:       end

[Source]

    # File lib/active_ldap/ldif.rb, line 62
62:       def normalize_value(value, result=[])
63:         case value
64:         when Array
65:           value.each {|val| normalize_value(val, result)}
66:         when Hash
67:           value.each do |option, val|
68:             normalize_value(val).each do |options, v|
69:               result << [[option] + options, v]
70:             end
71:           end
72:           result
73:         else
74:           result << [[], value]
75:         end
76:         result
77:       end

[Validate]