Permalink
Browse files

delegate PathSet's enumerator methods

  • Loading branch information...
1 parent c233b2f commit 759b03e74bc7f3821402edcf8119349f4416882c @nashby committed Nov 9, 2012
Showing with 2 additions and 20 deletions.
  1. +2 −20 actionpack/lib/action_view/path_set.rb
@@ -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

0 comments on commit 759b03e

Please sign in to comment.