Skip to content

Instantly share code, notes, and snippets.

@abrongersma
Created April 25, 2013 00:37
Show Gist options
  • Select an option

  • Save abrongersma/5456703 to your computer and use it in GitHub Desktop.

Select an option

Save abrongersma/5456703 to your computer and use it in GitHub Desktop.
class Array
def new_count
col = []
self.each do |v|
if yield(v) == false
0
elsif yield(v) == true
col << true
col.length
else
0
end
end
col.length
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment