Skip to content

Commit

Permalink
Merge pull request #32 from fowlmouth/patch-2
Browse files Browse the repository at this point in the history
Array#each_at (for great justice)
  • Loading branch information
ippa committed Jun 28, 2011
2 parents 762e5ec + a9dc7cd commit f68e36a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/chingu/core_ext/array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ class Array

def each_collision(*klasses)
self.each do |object1|
object1.each_collision(*klasses) do |object1, object2|
yield object1, object2
object1.each_collision(*klasses) do |object, object2|
yield object, object2
end
end
end
Expand All @@ -24,4 +24,12 @@ def each_bounding_box_collision(*klasses)
end
end

def each_at(x, y)
self.each do |object|
object.each_at(x, y) do |obj|
yield obj
end
end
end

end

0 comments on commit f68e36a

Please sign in to comment.