title: Find duplicate objects in an array based on a subset of attributes in Ruby
body: <p>I have an array of car objects,</p>
  
  <pre><code>class Car
  
    def initialize(engine_size, maximum_speed, acceleration, mass)
      @engine_size = engine_size
      @maximum_speed = maximum_speed
      @acceleration = acceleration
      @mass = mass
    end
  
  end
  </code></pre>
  
  <p>and I would like to list identical cars by comparing a subset of their attributes, for example: engine_size, acceleration and mass.</p>
  
  <p>I have tried using group_by however this only allows me to compare the entire car object or single attributes.</p>