Skip to content

Instantly share code, notes, and snippets.

@pzaich
Created June 18, 2012 03:08
Show Gist options
  • Select an option

  • Save pzaich/2946671 to your computer and use it in GitHub Desktop.

Select an option

Save pzaich/2946671 to your computer and use it in GitHub Desktop.
new_count method
class Array
def new_count
counter = 0
(0..self.length).each do |n, index|
if yield (n)
counter += 1
end
end
counter
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment