Skip to content

Loading…

delegate PathSet's enumerator methods #8151

Merged
merged 1 commit into from

4 participants

@nashby

No description provided.

@nikitug

Why not AS delegation here?

@nashby

@nikitug not sure if we need here something except Ruby Stdlib

@nikitug

@nashby yep, but maybe it's worth to keep the codebase more consistent. Take a look at ack 'delegate.*:to' in ActionPack.

@steveklabnik
Ruby on Rails member

We should use ActiveSupport's delegate here rather than Forwardable.

@steveklabnik
Ruby on Rails member

:+1: :shipit:

@carlosantoniodasilva carlosantoniodasilva merged commit 6710f05 into rails:master
@carlosantoniodasilva
Ruby on Rails member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 9, 2012
  1. @nashby
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 20 deletions.
  1. +2 −20 actionpack/lib/action_view/path_set.rb
View
22 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
Something went wrong with that request. Please try again.