Class: Spider::Sanitizer
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#sanitize(text, options = {}) ⇒ Object
7 8 9 10 |
# File 'lib/spiderfw/utils/sanitizer.rb', line 7 def sanitize(text, = {}) return text unless sanitizeable?(text) tokenize(text, ).join end |
#sanitizeable?(text) ⇒ Boolean
12 13 14 |
# File 'lib/spiderfw/utils/sanitizer.rb', line 12 def sanitizeable?(text) !(text.nil? || text.empty? || !text.index("<")) end |