Class: Email::Provider
- Inherits:
-
Object
- Object
- Email::Provider
- Defined in:
- lib/email/provider.rb,
lib/email/provider/base.rb
Defined Under Namespace
Classes: AppleMail, Base, Fastmail, GMail, Unknown
Class Method Summary collapse
Class Method Details
.for_address(address) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/email/provider.rb', line 9 def self.for_address(address) 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 else Email::Provider::Unknown.new end end |