require 'set'

module Perpetuity
  class AttributeSet
    include Enumerable

    def initialize
      @attributes = Set.new
    end

    def << attribute
      @attributes << attribute
    end

    def [] name
      @attributes.find { |attr| attr.name == name }
    end

    def each &block
      @attributes.each &block
    end
  end
end

require 'set'

module Perpetuity
  class AttributeSet < Set
    def [] name
      find { |attr| attr.name == name }
    end
  end
end

--- 
+++ 
@@ -1,9 +1,23 @@
 require 'set'
 
 module Perpetuity
-  class AttributeSet < Set
+  class AttributeSet
+    include Enumerable
+
+    def initialize
+      @attributes = Set.new
+    end
+
+    def << attribute
+      @attributes << attribute
+    end
+
     def [] name
-      find { |attr| attr.name == name }
+      @attributes.find { |attr| attr.name == name }
+    end
+
+    def each &block
+      @attributes.each &block
     end
   end
 end
Use composition in AttributeSet class
