Class: BounceFetcher::BounceFetcher
- Inherits:
-
Object
- Object
- BounceFetcher::BounceFetcher
- Defined in:
- lib/bounce_fetcher.rb
Instance Method Summary collapse
- #each(options = {}) ⇒ Object
-
#initialize(fetcher, extractor, detector) ⇒ BounceFetcher
constructor
A new instance of BounceFetcher.
Constructor Details
#initialize(fetcher, extractor, detector) ⇒ BounceFetcher
Returns a new instance of BounceFetcher.
16 17 18 19 20 |
# File 'lib/bounce_fetcher.rb', line 16 def initialize(fetcher, extractor, detector) @fetcher = fetcher @extractor = extractor @detector = detector end |
Instance Method Details
#each(options = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/bounce_fetcher.rb', line 22 def each( = {}) = { :delete => true }.merge() @fetcher.each do |e| if @detector.permanent_bounce?(e) @extractor.extract_emails(e.body).each do |email| yield email end e.delete if [:delete] end end end |