lib/super_settings.rb in super_settings-1.0.0 vs lib/super_settings.rb in super_settings-1.0.1
- old
+ new
@@ -21,10 +21,12 @@
# This is the main interface to the access settings.
module SuperSettings
DEFAULT_REFRESH_INTERVAL = 5.0
+ @local_cache = LocalCache.new(refresh_interval: DEFAULT_REFRESH_INTERVAL)
+
class << self
# Get a setting value cast to a string.
#
# @param key [String, Symbol]
# @param default [String] value to return if the setting value is nil
@@ -217,12 +219,10 @@
# to set authorization credentials stored client side to access the settings API.
attr_accessor :web_ui_javascript
private
- def local_cache
- @local_cache ||= LocalCache.new(refresh_interval: DEFAULT_REFRESH_INTERVAL)
- end
+ attr_reader :local_cache
def current_context
Thread.current[:super_settings_context]
end