Module: ImdbCelebrity::StringExtensions

Defined in:
lib/imdb_celebrity/string_extensions.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Strips out whitespace then tests if the string is empty.

Returns:

  • (Boolean)


18
19
20
# File 'lib/imdb_celebrity/string_extensions.rb', line 18

def blank?
  strip.empty?
end

#imdb_strip_tagsObject

Strip tags



13
14
15
# File 'lib/imdb_celebrity/string_extensions.rb', line 13

def imdb_strip_tags
  gsub(/<\/?[^>]*>/, "")
end

#imdb_unescape_htmlObject

Unescape HTML



8
9
10
# File 'lib/imdb_celebrity/string_extensions.rb', line 8

def imdb_unescape_html
  Iconv.conv("UTF-8", 'ISO-8859-1', CGI::unescapeHTML(self))
end