I have an array of car objects,
class Car
def initialize(engine_size, maximum_speed, acceleration, mass)
@engine_size = engine_size
@maximum_speed = maximum_speed
@acceleration = acceleration
@mass = mass
end
end
and I would like to list identical cars by comparing a subset of their attributes, for example: engine_size, acceleration and mass.
I have tried using group_by however this only allows me to compare the entire car object or single attributes.