-
Notifications
You must be signed in to change notification settings - Fork 252
Implement '==' operator for entries #381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
lib/net/ldap/entry.rb
Outdated
@@ -196,4 +196,8 @@ def setter?(sym) | |||
sym.to_s[-1] == ?= | |||
end | |||
private :setter? | |||
|
|||
def ==(other) | |||
return @myhash == other.to_h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return @myhash == other.to_h | |
@myhash == other.to_h |
Also, should this method check if the other
is the same class?
Should the equal operator work for sub classes of entries ? I was going to write |
While we don't really have an exposed way to create objects that inherit from Net::LDAP::Entry I would say those would be OK to consider equal as far as Class goes. For Ruby Hash objects
|
@erlliam |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Hey @HarlemSquirrel I was going through your profile and saw this repository. This issue seemed like something I could solve.
Resolves #372