Module: Imdb::StringExtensions
- Defined in:
- lib/imdb/string_extensions.rb
Instance Method Summary (collapse)
- - (Boolean) blank?
-
- (Object) imdb_strip_tags
Strip tags.
-
- (Object) imdb_unescape_html
Unescape HTML.
Instance Method Details
- (Boolean) blank?
22 23 24 |
# File 'lib/imdb/string_extensions.rb', line 22 def blank? strip.empty? end |
- (Object) imdb_strip_tags
Strip tags
17 18 19 |
# File 'lib/imdb/string_extensions.rb', line 17 def gsub(/<\/?[^>]*>/, "") end |
- (Object) imdb_unescape_html
Unescape HTML
7 8 9 10 11 12 13 14 |
# File 'lib/imdb/string_extensions.rb', line 7 def imdb_unescape_html if String.method_defined?(:encode) CGI::unescapeHTML(self.encode("UTF-8", 'ISO-8859-1')) else require 'iconv' Iconv.conv("UTF-8", 'ISO-8859-1', CGI::unescapeHTML(self)) end end |