Class: FactoryBotCaching::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/factory_bot_caching/config.rb

Constant Summary collapse

FIFTEEN_MINUTES_IN_SECONDS =
900

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



29
30
31
32
33
# 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

Instance Attribute Details

#cache_timeoutObject

Returns the value of attribute cache_timeout.



35
36
37
# File 'lib/factory_bot_caching/config.rb', line 35

def cache_timeout
  @cache_timeout
end

#custom_cache_keyObject

Returns the value of attribute custom_cache_key.



35
36
37
# File 'lib/factory_bot_caching/config.rb', line 35

def custom_cache_key
  @custom_cache_key
end

#factory_caching_enabledObject (readonly) Also known as: factory_caching_enabled?

Returns the value of attribute factory_caching_enabled.



35
36
37
# File 'lib/factory_bot_caching/config.rb', line 35

def factory_caching_enabled
  @factory_caching_enabled
end

Instance Method Details

#disable_factory_cachingObject



47
48
49
# File 'lib/factory_bot_caching/config.rb', line 47

def disable_factory_caching
  @factory_caching_enabled = false
end

#enable_factory_cachingObject



43
44
45
# File 'lib/factory_bot_caching/config.rb', line 43

def enable_factory_caching
  @factory_caching_enabled = true
end