Question

1. Write a Ruby class that represents an Item ordered by a customer. The attributes include item id, item name, item price, item count and total price. The class should include

the Ruby builtin mixin Comparable, so that Items in a list can be sorted by item count in descending order, followed by total price in descending order, followed by item name in alphabetic order. Documentation for Comparable can found at https://rubyapi.org/2.6/o/ comparable.

Fig: 1