Class: Metrocot::Scanners::StrippingTextScanner

Inherits:
BaseScanner
  • Object
show all
Defined in:
lib/metrocot.rb

Overview

just pulls out the plain text and strips it. This will probably one of the most commonly used scanner.

Instance Method Summary collapse

Instance Method Details

#scan(data) ⇒ Object



1120
1121
1122
1123
1124
1125
1126
1127
# File 'lib/metrocot.rb', line 1120

def scan( data )
  if data.is_a? Hpricot::Elem
    data = data.inner_text
  else
    data = data.to_s
  end
  data && data.strip
end