Class: Determinator::Cache::FetchWrapper
- Inherits:
-
Object
- Object
- Determinator::Cache::FetchWrapper
- Defined in:
- lib/determinator/cache/fetch_wrapper.rb
Instance Method Summary collapse
- #call(feature_name) ⇒ Object
-
#initialize(cache) ⇒ FetchWrapper
constructor
A new instance of FetchWrapper.
Constructor Details
#initialize(cache) ⇒ FetchWrapper
Returns a new instance of FetchWrapper.
5 6 7 |
# File 'lib/determinator/cache/fetch_wrapper.rb', line 5 def initialize(cache) @cache = cache end |
Instance Method Details
#call(feature_name) ⇒ Object
9 10 11 |
# File 'lib/determinator/cache/fetch_wrapper.rb', line 9 def call(feature_name) @cache.fetch(key(feature_name)) { yield } end |