Class: ScalewayTem::ActionMailer::Configuration

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

Overview

Global settings, set once at boot. Every field can also be overridden per delivery through ActionMailer's own settings hash, which is why DeliveryMethod merges rather than reads these directly.

Constant Summary collapse

DEFAULT_REGION =

Scaleway exposes Transactional Email in several regions. fr-par is the default because it is the one region TEM launched in and the one the official Symfony bridge assumes.

"fr-par"
DEFAULT_TIMEOUT =

Generous enough for a slow API, short enough that a stuck request does not hold a Puma thread or a Solid Queue worker for a minute.

15
DEFAULT_API_HOST =
"https://api.scaleway.com"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



22
23
24
25
26
27
# File 'lib/scaleway_tem/action_mailer/configuration.rb', line 22

def initialize
  @region = DEFAULT_REGION
  @timeout = DEFAULT_TIMEOUT
  @open_timeout = DEFAULT_TIMEOUT
  @api_host = DEFAULT_API_HOST
end

Instance Attribute Details

#api_hostObject

Returns the value of attribute api_host.



20
21
22
# File 'lib/scaleway_tem/action_mailer/configuration.rb', line 20

def api_host
  @api_host
end

#open_timeoutObject

Returns the value of attribute open_timeout.



20
21
22
# File 'lib/scaleway_tem/action_mailer/configuration.rb', line 20

def open_timeout
  @open_timeout
end

#project_idObject

Returns the value of attribute project_id.



20
21
22
# File 'lib/scaleway_tem/action_mailer/configuration.rb', line 20

def project_id
  @project_id
end

#regionObject

Returns the value of attribute region.



20
21
22
# File 'lib/scaleway_tem/action_mailer/configuration.rb', line 20

def region
  @region
end

#secret_keyObject

Returns the value of attribute secret_key.



20
21
22
# File 'lib/scaleway_tem/action_mailer/configuration.rb', line 20

def secret_key
  @secret_key
end

#timeoutObject

Returns the value of attribute timeout.



20
21
22
# File 'lib/scaleway_tem/action_mailer/configuration.rb', line 20

def timeout
  @timeout
end

Instance Method Details

#to_hObject



29
30
31
32
33
34
35
36
37
38
# File 'lib/scaleway_tem/action_mailer/configuration.rb', line 29

def to_h
  {
    secret_key: secret_key,
    project_id: project_id,
    region: region,
    timeout: timeout,
    open_timeout: open_timeout,
    api_host: api_host
  }
end