Class: DespamilatorFilter::Prices
- Inherits:
-
Despamilator::Filter
- Object
- Despamilator::Filter
- DespamilatorFilter::Prices
- Defined in:
- lib/despamilator/filter/prices.rb
Instance Method Summary collapse
Instance Method Details
#description ⇒ Object
8 9 10 |
# File 'lib/despamilator/filter/prices.rb', line 8 def description 'Detects prices in text.' end |
#name ⇒ Object
4 5 6 |
# File 'lib/despamilator/filter/prices.rb', line 4 def name 'Prices' end |
#parse(subject) ⇒ Object
12 13 14 15 |
# File 'lib/despamilator/filter/prices.rb', line 12 def parse subject price_count = subject.text.count(/\$\s*\d+/) subject.register_match!({:score => 0.075 * price_count, :filter => self}) if price_count > 0 end |