entry.rb 529 B

12345678910111213141516171819
  1. # Extends the 'net/ldap' class Net::LDAP::Entry
  2. # without overwriting methods.
  3. class Net::LDAP::Entry
  4. # Creates a duplicate of the internal Hash containing the
  5. # attributes of the entry.
  6. #
  7. # @see Net::LDAP::Entry#initialize
  8. # @see Net::LDAP::Entry#attribute_names
  9. #
  10. # @example get the Hash
  11. # entry.to_h
  12. # #=> {dn: ['...'], another_attribute: ['...', ...], ...}
  13. #
  14. # @return [Hash{Symbol=>Array<String>}] A duplicate of the internal Hash with the entries attributes.
  15. def to_h
  16. @myhash.dup
  17. end
  18. end