lib/monkey_patches.rb in zeke-monkey_patches-0.1.17 vs lib/monkey_patches.rb in zeke-monkey_patches-0.1.18
- old
+ new
@@ -145,10 +145,15 @@
# Removes tab characters and instances of more than one space
def remove_whitespace
self.gnix("\t").split(" ").remove_blanks.join(" ")
end
-
+
+ # Returns true if all letters in the string are capitalized
+ def upcase?
+ self.upcase == self
+ end
+
def replace_wonky_characters_with_ascii
t = self.to_s
t.gsub!(/–/, '-') # en-dash
t.gsub!(/—/, '--') # em-dash
t.gsub!(/…/, '...') # ellipsis
\ No newline at end of file