Module: StringExtensions

Defined in:
lib/string_extensions.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Strips out whitespace then tests if the string is empty.



15
16
17
# File 'lib/string_extensions.rb', line 15

def blank?
  strip.empty?
end

#strip_tagsObject

Strip tags



10
11
12
# File 'lib/string_extensions.rb', line 10

def strip_tags
  gsub(/<\/?[^>]*>/, '')
end

#unescape_htmlObject

Unescape HTML



5
6
7
# File 'lib/string_extensions.rb', line 5

def unescape_html
  CGI.unescapeHTML(encode('UTF-8'))
end