| Module | Fetcher |
| In: |
vendor/plugins/fetcher/lib/fetcher/base.rb
vendor/plugins/fetcher/lib/fetcher/imap.rb vendor/plugins/fetcher/lib/fetcher/pop.rb vendor/plugins/fetcher/lib/fetcher.rb |
Use factory-style initialization or insantiate directly from a subclass
Options:
Other options are the same as Fetcher::Base.new
Example:
Fetcher.create(:type => :pop) is equivalent to Fetcher::Pop.new()
# File vendor/plugins/fetcher/lib/fetcher.rb, line 13
13: def self.create(options={})
14: klass = options.delete(:type)
15: raise ArgumentError, 'Must supply a type' unless klass
16: module_eval "#{klass.to_s.capitalize}.new(options)"
17: end