Method: Net::LDAP#add_attribute
- Defined in:
- lib/net/ldap.rb
#add_attribute(dn, attribute, value) ⇒ Object
Add a value to an attribute. Takes the full DN of the entry to modify, the name (Symbol or String) of the attribute, and the value (String or Array). If the attribute does not exist (and there are no schema violations), #add_attribute will create it with the caller-specified values. If the attribute already exists (and there are no schema violations), the caller-specified values will be added to the values already present.
Returns True or False to indicate whether the operation succeeded or failed, with extended information available by calling #get_operation_result. See also #replace_attribute and #delete_attribute.
dn = "cn=modifyme,dc=example,dc=com"
ldap.add_attribute dn, :mail, "[email protected]"
917 918 919 |
# File 'lib/net/ldap.rb', line 917 def add_attribute dn, attribute, value modify :dn => dn, :operations => [[:add, attribute, value]] end |