Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/overrides/string.rb
Instance Method Summary collapse
Instance Method Details
#sentence_case ⇒ Object
7 8 9 |
# File 'lib/overrides/string.rb', line 7 def sentence_case self.split('.').first.gsub(/\W/, ' ').split(/(\A[\d]*[^a-zA-Z])/).last end |
#shell_escape ⇒ Object
11 12 13 |
# File 'lib/overrides/string.rb', line 11 def shell_escape %Q{"#{self}"} end |
#titleize ⇒ Object
3 4 5 |
# File 'lib/overrides/string.rb', line 3 def titleize self.split.each { |x| x.capitalize! }.join(' ') end |