ShardsOfPower/primitive_adds.rb

19 lines
216 B
Ruby
Raw Normal View History

2019-05-27 15:02:07 -04:00
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