This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # I was familiar with this, the keys here are "include Comparable" and the <=> method. | |
| # <=> return 1 for larger, 0 for equal, -1 for smaller than "other" | |
| class UndergradClassification | |
| include Comparable | |
| CLASSIFICATIONS = ["freshman", "sophomore", "junior", "senior"] | |
| attr_reader :name, :index | |
| def initialize(name) |
OlderNewer