Skip to content

Commit

Permalink
Merge pull request #8151 from nashby/forwardable
Browse files Browse the repository at this point in the history
delegate PathSet's enumerator methods
  • Loading branch information
carlosantoniodasilva committed Nov 9, 2012
2 parents 636ae13 + 759b03e commit 6710f05
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions actionpack/lib/action_view/path_set.rb
Expand Up @@ -5,6 +5,8 @@ class PathSet #:nodoc:


attr_reader :paths attr_reader :paths


delegate :[], :include?, :pop, :size, :each, to: :paths

def initialize(paths = []) def initialize(paths = [])
@paths = typecast paths @paths = typecast paths
end end
Expand All @@ -14,30 +16,10 @@ def initialize_copy(other)
self self
end end


def [](i)
paths[i]
end

def to_ary def to_ary
paths.dup paths.dup
end 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 def compact
PathSet.new paths.compact PathSet.new paths.compact
end end
Expand Down

0 comments on commit 6710f05

Please sign in to comment.