Class: Courrier::Configuration
- Inherits:
-
Object
- Object
- Courrier::Configuration
- Defined in:
- lib/courrier/configuration.rb,
lib/courrier/configuration/providers.rb
Defined Under Namespace
Classes: ProviderConfig, Providers
Instance Attribute Summary collapse
-
#auto_generate_text ⇒ Object
Returns the value of attribute auto_generate_text.
-
#bcc ⇒ Object
Returns the value of attribute bcc.
-
#cc ⇒ Object
Returns the value of attribute cc.
-
#default_url_options ⇒ Object
Returns the value of attribute default_url_options.
-
#email ⇒ Object
Returns the value of attribute email.
-
#email_path ⇒ Object
Returns the value of attribute email_path.
-
#from ⇒ Object
Returns the value of attribute from.
-
#layouts ⇒ Object
Returns the value of attribute layouts.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#providers ⇒ Object
readonly
Returns the value of attribute providers.
-
#reply_to ⇒ Object
Returns the value of attribute reply_to.
-
#subscriber ⇒ Object
Returns the value of attribute subscriber.
Instance Method Summary collapse
- #api_key ⇒ Object
- #api_key=(value) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #provider ⇒ Object
- #provider=(value) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/courrier/configuration.rb', line 26 def initialize @email = {provider: "logger"} @subscriber = {} @logger = ::Logger.new($stdout) @email_path = default_email_path @layouts = nil @default_url_options = {host: ""} @auto_generate_text = false @from = nil @reply_to = nil @cc = nil @bcc = nil @providers = Courrier::Configuration::Providers.new end |
Instance Attribute Details
#auto_generate_text ⇒ Object
Returns the value of attribute auto_generate_text.
21 22 23 |
# File 'lib/courrier/configuration.rb', line 21 def auto_generate_text @auto_generate_text end |
#bcc ⇒ Object
Returns the value of attribute bcc.
21 22 23 |
# File 'lib/courrier/configuration.rb', line 21 def bcc @bcc end |
#cc ⇒ Object
Returns the value of attribute cc.
21 22 23 |
# File 'lib/courrier/configuration.rb', line 21 def cc @cc end |
#default_url_options ⇒ Object
Returns the value of attribute default_url_options.
21 22 23 |
# File 'lib/courrier/configuration.rb', line 21 def @default_url_options end |
#email ⇒ Object
Returns the value of attribute email.
21 22 23 |
# File 'lib/courrier/configuration.rb', line 21 def email @email end |
#email_path ⇒ Object
Returns the value of attribute email_path.
21 22 23 |
# File 'lib/courrier/configuration.rb', line 21 def email_path @email_path end |
#from ⇒ Object
Returns the value of attribute from.
21 22 23 |
# File 'lib/courrier/configuration.rb', line 21 def from @from end |
#layouts ⇒ Object
Returns the value of attribute layouts.
21 22 23 |
# File 'lib/courrier/configuration.rb', line 21 def layouts @layouts end |
#logger ⇒ Object
Returns the value of attribute logger.
21 22 23 |
# File 'lib/courrier/configuration.rb', line 21 def logger @logger end |
#providers ⇒ Object (readonly)
Returns the value of attribute providers.
24 25 26 |
# File 'lib/courrier/configuration.rb', line 24 def providers @providers end |
#reply_to ⇒ Object
Returns the value of attribute reply_to.
21 22 23 |
# File 'lib/courrier/configuration.rb', line 21 def reply_to @reply_to end |
#subscriber ⇒ Object
Returns the value of attribute subscriber.
21 22 23 |
# File 'lib/courrier/configuration.rb', line 21 def subscriber @subscriber end |
Instance Method Details
#api_key ⇒ Object
57 58 59 60 61 |
# File 'lib/courrier/configuration.rb', line 57 def api_key warn "[DEPRECATION] `api_key` is deprecated. Use `email = { api_key: '…' }` instead. Will be removed in 1.0.0" @email[:api_key] end |
#api_key=(value) ⇒ Object
63 64 65 66 67 |
# File 'lib/courrier/configuration.rb', line 63 def api_key=(value) warn "[DEPRECATION] `api_key=` is deprecated. Use `email = { api_key: '…' }` instead. Will be removed in 1.0.0" @email[:api_key] = value end |
#provider ⇒ Object
45 46 47 48 49 |
# File 'lib/courrier/configuration.rb', line 45 def provider warn "[DEPRECATION] `provider` is deprecated. Use `email = { provider: '…' }` instead. Will be removed in 1.0.0" @email[:provider] end |
#provider=(value) ⇒ Object
51 52 53 54 55 |
# File 'lib/courrier/configuration.rb', line 51 def provider=(value) warn "[DEPRECATION] `provider=` is deprecated. Use `email = { provider: '…' }` instead. Will be removed in 1.0.0" @email[:provider] = value end |