Class: DevelopmentNotification::Config
- Inherits:
-
Object
- Object
- DevelopmentNotification::Config
- Defined in:
- lib/development_notification.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#leadersend_api_key ⇒ Object
Returns the value of attribute leadersend_api_key.
-
#leadersend_username ⇒ Object
Returns the value of attribute leadersend_username.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#domain ⇒ Object
Returns the value of attribute domain.
16 17 18 |
# File 'lib/development_notification.rb', line 16 def domain @domain end |
#leadersend_api_key ⇒ Object
Returns the value of attribute leadersend_api_key.
16 17 18 |
# File 'lib/development_notification.rb', line 16 def leadersend_api_key @leadersend_api_key end |
#leadersend_username ⇒ Object
Returns the value of attribute leadersend_username.
16 17 18 |
# File 'lib/development_notification.rb', line 16 def leadersend_username @leadersend_username end |
Class Method Details
.email_sending ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/development_notification.rb', line 24 def self.email_sending Leadersend.configure do |config| config.username = DevelopmentNotification.config.leadersend_username config.api_key = DevelopmentNotification.config.leadersend_api_key end ActionMailer::Base.smtp_settings = { :address => Leadersend.config.host, :port => '587', :authentication => :plain, :user_name => Leadersend.config.username, :password => Leadersend.config.api_key, :domain => DevelopmentNotification.config.domain } ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.[:host] = DevelopmentNotification.config.domain end |
Instance Method Details
#validate! ⇒ Object
18 19 20 21 22 |
# File 'lib/development_notification.rb', line 18 def validate! raise ArgumentError.new("DevelopmentNotification did not receive all three configuration pieces!") unless @leadersend_username && @leadersend_api_key && @domain Config.email_sending return true end |