Permalink
Browse files

Merge pull request #8151 from nashby/forwardable

delegate PathSet's enumerator methods
  • Loading branch information...
2 parents 636ae13 + 759b03e commit 6710f057f9033aec2ef62b961b9a2000a2d499e5 @carlosantoniodasilva carlosantoniodasilva 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 6710f05

Please sign in to comment.