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