You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sebastian Bazley <se...@apache.org> on 2016/03/16 02:27:07 UTC
[whimsy.git] [1/1] Commit aa75126: Make Person etc sortable
Commit aa75126d04754e047fe8f4fb0c6666b8270f2deb:
Make Person etc sortable
Branch: refs/heads/master
Author: Sebb <se...@apache.org>
Committer: Sebb <se...@apache.org>
Pusher: sebb <se...@apache.org>
------------------------------------------------------------
lib/whimsy/asf/ldap.rb | +++++
------------------------------------------------------------
5 changes: 5 additions, 0 deletions.
------------------------------------------------------------
diff --git a/lib/whimsy/asf/ldap.rb b/lib/whimsy/asf/ldap.rb
index 7e89b61..8d35383 100644
--- a/lib/whimsy/asf/ldap.rb
+++ b/lib/whimsy/asf/ldap.rb
@@ -201,6 +201,11 @@ def self.members
class Base
attr_reader :name
+ # define default sort key (make Base objects sortable)
+ def <=>(other)
+ @name <=> other.name
+ end
+
def self.base
@base
end