mishina2228/oanda-api-rails

View on GitHub
lib/resque/failure/notification_recipient.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module Resque
  module Failure
    module NotificationRecipient
      CONFIG_PATH = Rails.root.join('config/mail.yml')

      def recipients
        return unless File.exist?(CONFIG_PATH)

        options = YAML.safe_load_file(CONFIG_PATH, aliases: true, permitted_classes: [Symbol])[Rails.env]
        options['recipients']
      end
    end
  end
end