Class: Imap::Backup::Email::Provider
- Inherits:
- Object
- Object
- Imap::Backup::Email::Provider
- Defined in:
- lib/imap/backup/email/provider.rb,
lib/imap/backup/email/provider/base.rb
Overview
Provides a class factory for email account providers
Defined Under Namespace
Classes: AppleMail, Base, Fastmail, GMail, Purelymail, Unknown
Class Method Summary collapse
- .for_address(address) ⇒ Email::Provider::Fastmail, ...
An instance supplying default values for the email’s account set up.
Class Method Details
.for_address(address) ⇒ Email::Provider::Fastmail, ...
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | # File 'lib/imap/backup/email/provider.rb', line 18 def self.for_address(address) # rubocop:disable Lint/DuplicateBranch case when address.end_with?("@fastmail.com") Email::Provider::Fastmail.new when address.end_with?("@fastmail.fm") Email::Provider::Fastmail.new when address.end_with?("@gmail.com") Email::Provider::GMail.new when address.end_with?("@icloud.com") Email::Provider::AppleMail.new when address.end_with?("@mac.com") Email::Provider::AppleMail.new when address.end_with?("@me.com") Email::Provider::AppleMail.new when address.end_with?("@purelymail.com") Email::Provider::Purelymail.new else Email::Provider::Unknown.new end # rubocop:enable Lint/DuplicateBranch end |