Class: LucidShopify::CachedGet
- Inherits:
-
Object
- Object
- LucidShopify::CachedGet
- Extended by:
- Dry::Initializer
- Defined in:
- lib/lucid_shopify/cached_get.rb
Instance Method Summary collapse
- #cache ⇒ Cache
- #call(*get_args, ttl: Cache::TTL) ⇒ Object
- #clear(*get_args) ⇒ self
- #client ⇒ LucidShopify::Client
Instance Method Details
#cache ⇒ Cache
13 |
# File 'lib/lucid_shopify/cached_get.rb', line 13 option :cache, default: proc { Cache.new } |
#call(*get_args, ttl: Cache::TTL) ⇒ Object
22 23 24 |
# File 'lib/lucid_shopify/cached_get.rb', line 22 def call(*get_args, ttl: Cache::TTL) cache.(key(*get_args), ttl: ttl) { client.get(*get_args) }.freeze end |
#clear(*get_args) ⇒ self
31 32 33 34 35 |
# File 'lib/lucid_shopify/cached_get.rb', line 31 def clear(*get_args) cache.clear(key(*get_args)) self end |
#client ⇒ LucidShopify::Client
15 |
# File 'lib/lucid_shopify/cached_get.rb', line 15 option :client, default: proc { Client.new } |