Display the number of characters in the name of each month
1 2 months = %w(January February March April May June July August September October November December) 3 months.each { |m| print m, " (", m.length, ")\n" }
DZone Snippets > logankoester > ruby
12963 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Logan Koester http://logankoester.com
1 2 months = %w(January February March April May June July August September October November December) 3 months.each { |m| print m, " (", m.length, ")\n" }
1 2 map.domain 'domains/:id', :controller => 'domains', :action => 'show', :requirements => { :id => /[a-zA-Z0-9\-\.]+/ }
1 2 Array.new(6) { (rand(122-97) + 97).chr }.join
1 2 Array.new(6) { (rand(122-97) + 97).chr }.join
1 2 Array.new(6) { (rand(122-97) + 97).chr }.join
1 2 Array.new(6) { (rand(122-97) + 97).chr }.join
1 2 Array.new(6) { (rand(122-97) + 97).chr }.join