title: check if array includes an instance with a certain value for an instance variable Ruby
body: <p>So if a have this code:</p>
  
  <pre><code>class A
      def initialize(type)
          @type = type
      end
  end
  
  instance = A.new(2)
  another_instance = A.new(1)
  
  array = [instance, another_instance]
  </code></pre>
  
  <p>is there a way to check if <code>array</code> includes an instance of <code>A</code> where <code>@type</code> is equal to a certain value?  say, 2?  like the <code>include?</code> method but where instead of checking for an instance of a certain class, it also checks the instance variables of that class?</p>