delegate PathSet's enumerator methods #8151

Merged
merged 1 commit into from Nov 9, 2012
Jump to file or symbol
Failed to load files and symbols.
+2 −20
Diff settings

Always

Just for now

@@ -5,6 +5,8 @@ class PathSet #:nodoc:
attr_reader :paths
+ delegate :[], :include?, :pop, :size, :each, to: :paths
+
def initialize(paths = [])
@paths = typecast paths
end
@@ -14,30 +16,10 @@ def initialize_copy(other)
self
end
- def [](i)
- paths[i]
- end
-
def to_ary
paths.dup
end
- def include?(item)
- paths.include? item
- end
-
- def pop
- paths.pop
- end
-
- def size
- paths.size
- end
-
- def each(&block)
- paths.each(&block)
- end
-
def compact
PathSet.new paths.compact
end