Class: FactoryBotCaching::Config
- Inherits:
-
Object
- Object
- FactoryBotCaching::Config
- Defined in:
- lib/factory_bot_caching/config.rb
Constant Summary collapse
- FIFTEEN_MINUTES_IN_SECONDS =
900
Instance Attribute Summary collapse
-
#cache_timeout ⇒ Object
Returns the value of attribute cache_timeout.
-
#custom_cache_key ⇒ Object
Returns the value of attribute custom_cache_key.
-
#factory_caching_enabled ⇒ Object
(also: #factory_caching_enabled?)
readonly
Returns the value of attribute factory_caching_enabled.
Instance Method Summary collapse
- #disable_factory_caching ⇒ Object
- #enable_factory_caching ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
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_timeout ⇒ Object
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_key ⇒ Object
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_enabled ⇒ Object (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_caching ⇒ Object
47 48 49 |
# File 'lib/factory_bot_caching/config.rb', line 47 def disable_factory_caching @factory_caching_enabled = false end |
#enable_factory_caching ⇒ Object
43 44 45 |
# File 'lib/factory_bot_caching/config.rb', line 43 def enable_factory_caching @factory_caching_enabled = true end |