Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 8758ddb3c6
Fetching contributors…

Cannot retrieve contributors at this time

17 lines (15 sloc) 0.365 kB
class String
# Return an alternate string if blank.
def or_else(alternate)
blank? ? alternate : self
end
# Capitalize each word (space separated).
def capitalize_each
space = " "
split(space).each{ |word| word.capitalize! }.join(space)
end
# Capitalize each word in place.
def capitalize_each!
replace capitalize_each
end
end
Jump to Line
Something went wrong with that request. Please try again.