Skip to content

Instantly share code, notes, and snippets.

@kalupa
Forked from awd/gist:3994607
Created November 1, 2012 19:44
Show Gist options
  • Save kalupa/3995969 to your computer and use it in GitHub Desktop.
Save kalupa/3995969 to your computer and use it in GitHub Desktop.
how to determine one name vs another..
def make_selection
selections = []
1000.times { selections << ["manage", "settings"].sample }
selections.select { |s| s == "manage" }.size > selections.select { |s| s == "settings" }.size ? "manage" : "settings"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment