Class: MailProcessor::Processor
- Defined in:
- lib/mail_processor/processor.rb
Instance Method Summary collapse
-
#initialize(options = {}, &block) ⇒ Processor
constructor
A new instance of Processor.
- #process(options = {}, &block) ⇒ Object
- #retriever(method, options = {}, &block) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(options = {}, &block) ⇒ Processor
Returns a new instance of Processor.
7 8 9 10 11 12 13 |
# File 'lib/mail_processor/processor.rb', line 7 def initialize = {}, &block @attributes = { :retriever => nil } instance_eval &block self end |
Instance Method Details
#process(options = {}, &block) ⇒ Object
28 29 30 |
# File 'lib/mail_processor/processor.rb', line 28 def process = {}, &block @retriever.process &block end |
#retriever(method, options = {}, &block) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/mail_processor/processor.rb', line 16 def retriever method, = {}, &block @retriever = case method when :pop3 then Pop3.new , &block when :mail_dir then MailDir.new , &block else raise UnkownRetrieverError, "Retriever type #{method.to_s} not known" end end |