| Class | Fetcher::Base |
| In: |
vendor/plugins/fetcher/lib/fetcher/base.rb
|
| Parent: | Object |
Options:
receiver object has a receive method that takes a message as it‘s argument
Additional protocol-specific options implimented by sub-classes
Example:
Fetcher::Base.new(:server => 'mail.example.com',
:username => 'pam',
:password => 'test',
:receiver => IncomingMailHandler)
# File vendor/plugins/fetcher/lib/fetcher/base.rb, line 17
17: def initialize(options={})
18: %w(server username password receiver).each do |opt|
19: raise ArgumentError, "#{opt} is required" unless options[opt.to_sym]
20: instance_eval("@#{opt} = options[:#{opt}]")
21: end
22: end
Run the fetching process
# File vendor/plugins/fetcher/lib/fetcher/base.rb, line 25
25: def fetch
26: establish_connection
27: get_messages
28: close_connection
29: end