diff --git a/lib/review/book/cache.rb b/lib/review/book/cache.rb index 6dec993e..27f5f8d7 100644 --- a/lib/review/book/cache.rb +++ b/lib/review/book/cache.rb @@ -21,19 +21,19 @@ def reset def fetch(key, &block) raise ArgumentError, 'Key should be Symbol' unless key.is_a?(Symbol) - if key?(key) + if cached?(key) read(key) else exec_block_and_save(key, &block) end end - private - - def key?(key) + def cached?(key) @store.key?(key) end + private + def read(key) @store[key] end