Module: Imdb::StringExtensions

Defined in:
lib/imdb/string_extensions.rb

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Strips out whitespace then tests if the string is empty.

Returns:

  • (Boolean)


19
20
21
# File 'lib/imdb/string_extensions.rb', line 19

def blank?
  strip.empty?
end

#imdb_strip_tagsObject

Strip tags



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

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

#imdb_unescape_htmlObject

Unescape HTML



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

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