module Terraformer module Credentials class Datadog def self.get_from_options(options) credentials = {} %w(datadog_api_key datadog_app_key).each do |key| datadog_key = key.sub("datadog_", "").to_sym credentials[datadog_key] = options[key.to_sym].nil? ? options[key] : options[key.to_sym] credentials[datadog_key] = ENV[key.upcase] if credentials[datadog_key].nil? end credentials.reject{ |k, v| v.nil? } end end end end