Class: MailAutomation::Configuration

Inherits:
Common::Client::Configuration::REST show all
Defined in:
lib/mail_automation/configuration.rb

Instance Attribute Summary

Attributes inherited from Common::Client::Configuration::Base

#base_request_headers, #open_timeout, #read_timeout, #request_types, #user_agent

Instance Method Summary collapse

Methods inherited from Common::Client::Configuration::Base

#breakers_error_threshold, #breakers_exception_handler, #breakers_matcher, #breakers_service, #create_new_breakers_service, #current_module, #request_options, #service_exception

Instance Method Details

#base_pathObject



11
12
13
# File 'lib/mail_automation/configuration.rb', line 11

def base_path
  Settings.mail_automation.url
end

#connectionObject



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/mail_automation/configuration.rb', line 19

def connection
  Faraday.new(base_path, headers: base_request_headers, request: request_options) do |faraday|
    faraday.use :breakers
    faraday.use Faraday::Response::RaiseError

    # Uncomment this if you want curl command equivalent or response output to log
    # faraday.request(:curl, ::Logger.new($stdout), :warn) unless Rails.env.production?
    # faraday.response(:logger, ::Logger.new($stdout), bodies: true) unless Rails.env.production?

    faraday.response :json
    faraday.adapter Faraday.default_adapter
  end
end

#service_nameObject



15
16
17
# File 'lib/mail_automation/configuration.rb', line 15

def service_name
  'MasNotificationClient'
end