Modules and Mixins • Exercise 2/2

Comparable Module

00:00
0
25 points

Instructions

Create a Box class that:

  • Has a volume attribute (set in initialize)
  • Includes the Comparable module
  • Implements the <=> (spaceship) operator to compare by volume

This will give you <, >, ==, <=, >= for free!

Your Code

Results

Click "Run Tests" to see results