Intermediate
Ruby
Q50 / 100
What does "Comparable" module provide when a class implements "<=>"?
Correct! Well done.
Incorrect.
The correct answer is B) Comparison operators like <, >, <=, >=, ==, and the between? method, derived from the <=> implementation
B
Correct Answer
Comparison operators like <, >, <=, >=, ==, and the between? method, derived from the <=> implementation
Explanation
Including Comparable and defining <=> gives the class all standard comparison operators and helper methods like clamp and between? for free.
Progress
50/100