Module: Cowtech::Extensions::String

Extended by:
ActiveSupport::Concern
Defined in:
lib/cowtech-extensions/string.rb

Instance Method Summary collapse

Instance Method Details

#remove_accentsObject



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_ampersandsObject



22
23
24
# File 'lib/cowtech-extensions/string.rb', line 22

def replace_ampersands
	self.gsub(/&(\S+);/, "&\\1;")
end

#untitleizeObject



18
19
20
# File 'lib/cowtech-extensions/string.rb', line 18

def untitleize
	self.downcase.gsub(" ", "-")
end

#valueObject



26
27
28
# File 'lib/cowtech-extensions/string.rb', line 26

def value
	self
end