Skip to content

Commit

Permalink
Made code a tiny bit more semantical.
Browse files Browse the repository at this point in the history
  • Loading branch information
mynyml committed Mar 22, 2009
1 parent 8000a4d commit a4794a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ arguments? sure:
%w( axb dxf ).every.gsub(/x/) { 'y' } #=> ['ayb', 'dyf']


(checkout branches for experimental chaining)
(see branches for experimental chaining)
6 changes: 3 additions & 3 deletions lib/every.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class Every
instance_methods.each { |m| undef_method(m) unless m.match(/^__/) }
def initialize(obj)
@obj = obj
def initialize(enum)
@enum = enum
end
def method_missing(method, *args, &block)
@obj.map {|o| o.__send__(method, *args, &block) }
@enum.map {|o| o.__send__(method, *args, &block) }
end
end

Expand Down

0 comments on commit a4794a3

Please sign in to comment.