Module: Gares::StringExtensions

Defined in:
lib/gares/string_extensions.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)

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

def blank?
  strip.empty?
end

#strip_tagsObject

Strip tags


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

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

#unescape_htmlObject

Unescape HTML


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

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