Class: Emailbutler::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/emailbutler/configuration.rb

Constant Summary collapse

InitializeError =
Class.new(StandardError)
AVAILABLE_ADAPTERS =
%w[
  Emailbutler::Adapters::ActiveRecord
].freeze
AVAILABLE_PROVIDERS =
%w[sendgrid smtp2go resend mailjet mailtrap mandrill].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



14
15
16
17
18
19
20
21
22
23
# File 'lib/emailbutler/configuration.rb', line 14

def initialize
  @adapter = nil
  @providers = []

  # It's required to specify these 3 variables to enable basic auth to UI
  @ui_username = ''
  @ui_password = ''
  # Secured environments variable must directly contains environment names
  @ui_secured_environments = []
end

Instance Attribute Details

#adapterObject

Returns the value of attribute adapter.



12
13
14
# File 'lib/emailbutler/configuration.rb', line 12

def adapter
  @adapter
end

#providersObject

Returns the value of attribute providers.



12
13
14
# File 'lib/emailbutler/configuration.rb', line 12

def providers
  @providers
end

#ui_passwordObject

Returns the value of attribute ui_password.



12
13
14
# File 'lib/emailbutler/configuration.rb', line 12

def ui_password
  @ui_password
end

#ui_secured_environmentsObject

Returns the value of attribute ui_secured_environments.



12
13
14
# File 'lib/emailbutler/configuration.rb', line 12

def ui_secured_environments
  @ui_secured_environments
end

#ui_usernameObject

Returns the value of attribute ui_username.



12
13
14
# File 'lib/emailbutler/configuration.rb', line 12

def ui_username
  @ui_username
end

Instance Method Details

#validateObject

Raises:



25
26
27
# File 'lib/emailbutler/configuration.rb', line 25

def validate
  raise InitializeError, 'Invalid adapter' if adapter.nil?
end