Module: StringExtensions
- Defined in:
- lib/string_extensions.rb
Instance Method Summary collapse
-
#blank? ⇒ Boolean
Strips out whitespace then tests if the string is empty.
-
#strip_tags ⇒ Object
Strip tags.
-
#unescape_html ⇒ Object
Unescape HTML.
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_tags ⇒ Object
Strip tags
10 11 12 |
# File 'lib/string_extensions.rb', line 10 def gsub(/<\/?[^>]*>/, '') end |
#unescape_html ⇒ Object
Unescape HTML
5 6 7 |
# File 'lib/string_extensions.rb', line 5 def unescape_html CGI.unescapeHTML(encode('UTF-8')) end |