class Emarsys::Configuration

Attributes

config_sets[RW]
api_endpoint[W]

@!attribute api_endpoint

@return [String] Base URL for emarsys URLs. default: https://api.emarsys.net/api/v2

@!attribute api_password

@return [String] API Username given by Emarsys

@!attribute api_username

@return [String] API Username given by Emarsys
api_password[W]

@!attribute api_endpoint

@return [String] Base URL for emarsys URLs. default: https://api.emarsys.net/api/v2

@!attribute api_password

@return [String] API Username given by Emarsys

@!attribute api_username

@return [String] API Username given by Emarsys
api_username[W]

@!attribute api_endpoint

@return [String] Base URL for emarsys URLs. default: https://api.emarsys.net/api/v2

@!attribute api_password

@return [String] API Username given by Emarsys

@!attribute api_username

@return [String] API Username given by Emarsys
open_timeout[RW]

@!attribute open_timeout

@return [Integer] Connect Timeout. default: RestClient timeout which is 60s

@!attribute read_timeout

@return [Integer] Read Timeout. default: RestClient timeout which is 60s
read_timeout[RW]

@!attribute open_timeout

@return [Integer] Connect Timeout. default: RestClient timeout which is 60s

@!attribute read_timeout

@return [Integer] Read Timeout. default: RestClient timeout which is 60s

Public Class Methods

configure(account: :default) { |config_sets| ... } click to toggle source
# File lib/emarsys/configuration.rb, line 21
def configure(account: :default)
  self.config_sets ||= {}
  account_sym = account.to_sym
  self.config_sets[account_sym] ||= self.new
  yield self.config_sets[account_sym]
end
for(account) click to toggle source
# File lib/emarsys/configuration.rb, line 8
def for(account)
  self.config_sets ||= {}
  if account.nil?
    raise Emarsys::AccountRequired unless Emarsys.allow_default_configuration
    account = :default
  end
  account_sym = account.to_sym
  if self.config_sets[account_sym].nil?
    raise Emarsys::AccountNotConfigured
  end
  self.config_sets[account_sym]
end

Public Instance Methods

api_endpoint() click to toggle source

Base URL for the Emarsys API

@return [String] domain which should be used to query the API

# File lib/emarsys/configuration.rb, line 41
def api_endpoint
  @api_endpoint ||= 'https://api.emarsys.net/api/v2'
end
api_password() click to toggle source
# File lib/emarsys/configuration.rb, line 49
def api_password
  @api_password or raise ArgumentError.new('api_password is not set')
end
api_username() click to toggle source
# File lib/emarsys/configuration.rb, line 45
def api_username
  @api_username or raise ArgumentError.new('api_username is not set')
end