19 lines
216 B
Ruby
19 lines
216 B
Ruby
class String
|
|
def titleize
|
|
gsub(/\w+/i) do |match|
|
|
ret = match.downcase
|
|
ret[0] = ret[0].upcase
|
|
ret
|
|
end
|
|
end
|
|
|
|
def titleize!
|
|
replace titleize
|
|
end
|
|
end
|
|
|
|
class Integer
|
|
def to_dots
|
|
"•" * self
|
|
end
|
|
end |