Module: Cowtech::Extensions::String
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/cowtech-extensions/string.rb
Instance Method Summary collapse
Instance Method Details
#remove_accents ⇒ Object
14 15 16 |
# File 'lib/cowtech-extensions/string.rb', line 14 def remove_accents self.mb_chars.normalize(:kd).gsub(/[^\-x00-\x7F]/n, "").to_s end |
#replace_ampersands ⇒ Object
22 23 24 |
# File 'lib/cowtech-extensions/string.rb', line 22 def replace_ampersands self.gsub(/&(\S+);/, "&\\1;") end |
#untitleize ⇒ Object
18 19 20 |
# File 'lib/cowtech-extensions/string.rb', line 18 def untitleize self.downcase.gsub(" ", "-") end |
#value ⇒ Object
26 27 28 |
# File 'lib/cowtech-extensions/string.rb', line 26 def value self end |