class FactoryBotCaching::Config

Constants

FIFTEEN_MINUTES_IN_SECONDS

Attributes

cache_timeout[R]
custom_cache_key[R]
factory_caching_enabled[R]
factory_caching_enabled?[R]

Public Class Methods

new() click to toggle source
# File lib/factory_bot_caching/config.rb, line 29
def initialize
  @factory_caching_enabled = false
  @custom_cache_key = nil
  @cache_timeout = FIFTEEN_MINUTES_IN_SECONDS
end

Public Instance Methods

cache_timeout=(seconds) click to toggle source
# File lib/factory_bot_caching/config.rb, line 38
def cache_timeout=(seconds)
  raise ArgumentError, 'Cache timeout must be an Integer!' unless seconds.is_a?(Integer)
  @cache_timeout = seconds
end
custom_cache_key=(block) click to toggle source
# File lib/factory_bot_caching/config.rb, line 51
def custom_cache_key=(block)
  raise ArgumentError, 'The custom cache key must be a Proc!' unless block.instance_of?(Proc)
  @custom_cache_key = block
end
disable_factory_caching() click to toggle source
# File lib/factory_bot_caching/config.rb, line 47
def disable_factory_caching
  @factory_caching_enabled = false
end
enable_factory_caching() click to toggle source
# File lib/factory_bot_caching/config.rb, line 43
def enable_factory_caching
  @factory_caching_enabled = true
end