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

Methods

create  

Classes and Modules

Class Fetcher::Base
Class Fetcher::Imap
Class Fetcher::Pop

Public Class methods

Use factory-style initialization or insantiate directly from a subclass

Options:

  • :type - Name of class as a symbol to instantiate

Other options are the same as Fetcher::Base.new

Example:

Fetcher.create(:type => :pop) is equivalent to Fetcher::Pop.new()

[Source]

    # 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

[Validate]