Skip to content

mikelovesrobots/robot_enumerable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

robot_enumerable

robot_enumerable is a collection of useful additions to the Array and Hash classes.

What does this mean? It means that you can accomplish more with less code. It means that the code you write is clearer and cleaner. It’s very ruby.

["a", "b", "c", "a"].dupes?
# => true

["Sarah", "SARAH", "sarah"].uniq_by { |x| x.downcase }
# => ["Sarah"]

select_options = [[:ca, "Canada"], [:usa, "United States"], [:mex, "Mexico"]]
select_options.bump_to_front { |abbr, label| abbr == :usa }
# => [[:usa, "United States"], [:ca, "Canada"], [:mex, "Mexico"]]

Note on Patches/Pull Requests

  • Fork the project on github

  • Make your feature addition or bug fix.

  • Add tests for it if you really want to be a pal.

  • Commit, please do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. If I include it, I’ll add you to the list of contributors in this readme file.

Copyright © 2010 Mike Judge (mikelovesrobots). See LICENSE for details.

About

robot_enumerable is a collection of useful additions to the Array and Hash classes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages