# File lib/puppet/network/authstore.rb, line 134
134:             def <=>(other)
135:                 # Sort first based on whether the matches are exact.
136:                 if r = compare(exact?, other.exact?)
137:                     return r
138:                 end
139: 
140:                 # Then by type
141:                 if r = compare(self.ip?, other.ip?)
142:                     return r
143:                 end
144: 
145:                 # Next sort based on length
146:                 unless self.length == other.length
147:                     # Longer names/ips should go first, because they're more
148:                     # specific.
149:                     return other.length <=> self.length
150:                 end
151: 
152:                 # Then sort deny before allow
153:                 if r = compare(self.deny?, other.deny?)
154:                     return r
155:                 end
156: 
157:                 # We've already sorted by name and length, so all that's left
158:                 # is the pattern
159:                 if ip?
160:                     return self.pattern.to_s <=> other.pattern.to_s
161:                 else
162:                     return self.pattern <=> other.pattern
163:                 end
164:             end