Method: ElasticEmail::Configuration#api_key_with_prefix

Defined in:
lib/ElasticEmail/configuration.rb

#api_key_with_prefix(param_name, param_alias = nil) ⇒ Object

Gets API key (with prefix if set).

Parameters:

  • the parameter name of API key auth



213
214
215
216
217
218
219
220
221
# File 'lib/ElasticEmail/configuration.rb', line 213

def api_key_with_prefix(param_name, param_alias = nil)
  key = @api_key[param_name]
  key = @api_key.fetch(param_alias, key) unless param_alias.nil?
  if @api_key_prefix[param_name]
    "#{@api_key_prefix[param_name]} #{key}"
  else
    key
  end
end