Module: Tangocard

Defined in:
lib/tangocard.rb,
lib/tangocard/version.rb

Defined Under Namespace

Classes: Account, AccountCreateFailedException, AccountDeleteCreditCardFailedException, AccountFundFailedException, AccountNotFoundException, AccountRegisterCreditCardFailedException, Brand, Configuration, ExchangeRate, Order, OrderCreateFailedException, OrderNotFoundException, Raas, RaasException, Response, Reward

Constant Summary collapse

CACHE_PREFIX =
"tangocard:#{VERSION}:"
VERSION =
'7.0.3'

Class Method Summary collapse

Class Method Details

.configurationObject


29
30
31
# File 'lib/tangocard.rb', line 29

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:


33
34
35
36
# File 'lib/tangocard.rb', line 33

def self.configure
  yield(configuration) if block_given?
  warm_cache if configuration.use_cache
end

.warm_cacheObject


38
39
40
41
# File 'lib/tangocard.rb', line 38

def self.warm_cache
  configuration.cache.write("#{Tangocard::CACHE_PREFIX}rewards_index", Tangocard::Raas.rewards_index(use_cache: false))
  configuration.logger.info('Warmed Tangocard cache')
end