Skip to content

Instantly share code, notes, and snippets.

@surrealdetective
Created June 15, 2013 22:22
Show Gist options
  • Save surrealdetective/5789802 to your computer and use it in GitHub Desktop.
Save surrealdetective/5789802 to your computer and use it in GitHub Desktop.
remaking the methods for all, any, and none, i choose you!
def myAll(myTeam)
if block_given?
myTeam.each do |pokemon|
if !yield pokemon
return false
end
end
end
return true
end
def myAny(myTeam)
if block_given?
myTeam.each do |pokemon|
if yield pokemon
return true
end
end
return false
end
return true
end
def myNone(myTeam)
if block_given?
myTeam.each do |pokemon|
if yield pokemon
return false
end
end
return true
end
return false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment