Class: Email::Provider
- Inherits:
-
Object
- Object
- Email::Provider
- Defined in:
- lib/email/provider.rb
Instance Attribute Summary collapse
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
Class Method Summary collapse
Instance Method Summary collapse
- #host ⇒ Object
-
#initialize(provider) ⇒ Provider
constructor
A new instance of Provider.
- #options ⇒ Object
Constructor Details
#initialize(provider) ⇒ Provider
Returns a new instance of Provider.
19 20 21 |
# File 'lib/email/provider.rb', line 19 def initialize(provider) @provider = provider end |
Instance Attribute Details
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
17 18 19 |
# File 'lib/email/provider.rb', line 17 def provider @provider end |
Class Method Details
.for_address(address) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/email/provider.rb', line 4 def self.for_address(address) case when address.end_with?("@fastmail.com") new(:fastmail) when address.end_with?("@gmail.com") new(:gmail) when address.end_with?("@fastmail.fm") new(:fastmail) else new(:default) end end |
Instance Method Details
#host ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/email/provider.rb', line 27 def host case provider when :gmail "imap.gmail.com" when :fastmail "imap.fastmail.com" end end |
#options ⇒ Object
23 24 25 |
# File 'lib/email/provider.rb', line 23 def {port: 993, ssl: {ssl_version: :TLSv1_2}} end |