Module ActiveLdap::HumanReadable::ClassMethods
In: lib/active_ldap/human_readable.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

Public Instance methods

[Source]

    # File lib/active_ldap/human_readable.rb, line 31
31:       def human_attribute_description(attribute_or_name)
32:         msgid = human_attribute_description_msgid(attribute_or_name)
33:         return nil if msgid.nil?
34:         s_(msgid)
35:       end

[Source]

    # File lib/active_ldap/human_readable.rb, line 37
37:       def human_attribute_description_msgid(attribute_or_name)
38:         if attribute_or_name.is_a?(Schema::Attribute)
39:           attribute = attribute_or_name
40:         else
41:           attribute = schema.attribute(attribute_or_name)
42:           return nil if attribute.nil?
43:         end
44:         description = attribute.description
45:         return nil if description.nil?
46:         "LDAP|Description|Attribute|#{attribute.name}|#{description}"
47:       end

[Source]

    # File lib/active_ldap/human_readable.rb, line 9
 9:       def human_attribute_name(attribute_or_name)
10:         msgid = human_attribute_name_msgid(attribute_or_name)
11:         msgid ||= human_attribute_name_with_gettext(attribute_or_name)
12:         s_(msgid)
13:       end

[Source]

    # File lib/active_ldap/human_readable.rb, line 15
15:       def human_attribute_name_msgid(attribute_or_name)
16:         if attribute_or_name.is_a?(Schema::Attribute)
17:           name = attribute_or_name.name
18:         else
19:           attribute = schema.attribute(attribute_or_name)
20:           return nil if attribute.id.nil?
21:           if attribute.name == attribute_or_name or
22:               attribute.aliases.include?(attribute_or_name)
23:             name = attribute_or_name
24:           else
25:             return nil
26:           end
27:         end
28:         "LDAP|Attribute|#{name}"
29:       end

[Source]

    # File lib/active_ldap/human_readable.rb, line 62
62:       def human_object_class_description(object_class_or_name)
63:         msgid = human_object_class_description_msgid(object_class_or_name)
64:         return nil if msgid.nil?
65:         s_(msgid)
66:       end

[Source]

    # File lib/active_ldap/human_readable.rb, line 68
68:       def human_object_class_description_msgid(object_class_or_name)
69:         if object_class_or_name.is_a?(Schema::ObjectClass)
70:           object_class = object_class_or_name
71:         else
72:           object_class = schema.object_class(object_class_or_name)
73:           return nil if object_class.nil?
74:         end
75:         description = object_class.description
76:         return nil if description.nil?
77:         "LDAP|Description|ObjectClass|#{object_class.name}|#{description}"
78:       end

[Source]

    # File lib/active_ldap/human_readable.rb, line 49
49:       def human_object_class_name(object_class_or_name)
50:         s_(human_object_class_name_msgid(object_class_or_name))
51:       end

[Source]

    # File lib/active_ldap/human_readable.rb, line 53
53:       def human_object_class_name_msgid(object_class_or_name)
54:         if object_class_or_name.is_a?(Schema::ObjectClass)
55:           name = object_class_or_name.name
56:         else
57:           name = object_class_or_name
58:         end
59:         "LDAP|ObjectClass|#{name}"
60:       end

[Source]

     # File lib/active_ldap/human_readable.rb, line 111
111:       def human_readable_format(object)
112:         case object
113:         when Array
114:           "[#{object.collect {|value| human_readable_format(value)}.join(', ')}]"
115:         when Hash
116:           formatted_values = []
117:           object.each do |key, value|
118:             formatted_values << [human_readable_format(key),
119:                                  human_readable_format(value)].join("=>")
120:           end
121:           "{#{formatted_values.join(', ')}}"
122:         else
123:           if object.respond_to?(:to_human_readable_format)
124:             object.to_human_readable_format
125:           else
126:             object.inspect
127:           end
128:         end
129:       end

[Source]

    # File lib/active_ldap/human_readable.rb, line 93
93:       def human_syntax_description(syntax_or_id)
94:         msgid = human_syntax_description_msgid(syntax_or_id)
95:         return nil if msgid.nil?
96:         s_(msgid)
97:       end

[Source]

     # File lib/active_ldap/human_readable.rb, line 99
 99:       def human_syntax_description_msgid(syntax_or_id)
100:         if syntax_or_id.is_a?(Schema::Syntax)
101:           syntax = syntax_or_id
102:         else
103:           syntax = schema.ldap_syntax(syntax_or_id)
104:           return nil if syntax.nil?
105:         end
106:         description = syntax.description
107:         return nil if description.nil?
108:         "LDAP|Description|Syntax|#{syntax.id}|#{description}"
109:       end

[Source]

    # File lib/active_ldap/human_readable.rb, line 80
80:       def human_syntax_name(syntax_or_id)
81:         s_(human_syntax_name_msgid(syntax_or_id))
82:       end

[Source]

    # File lib/active_ldap/human_readable.rb, line 84
84:       def human_syntax_name_msgid(syntax_or_id)
85:         if syntax_or_id.is_a?(Schema::Syntax)
86:           id = syntax_or_id.id
87:         else
88:           id = syntax_or_id
89:         end
90:         "LDAP|Syntax|#{id}"
91:       end

[Validate]