class LucidShopify::CachedGet
Public Instance Methods
call(*get_args, ttl: Cache::TTL)
click to toggle source
@see {LucidShopify::Client#get}
@param ttl [Integer]
# File lib/lucid_shopify/cached_get.rb, line 23 def call(*get_args, ttl: Cache::TTL) cache.(key(*get_args), ttl: ttl) { client.get(*get_args).to_h }.freeze end
clear(*get_args)
click to toggle source
@see {LucidShopify::Client#get}
@return [self]
# File lib/lucid_shopify/cached_get.rb, line 32 def clear(*get_args) cache.clear(key(*get_args)) self end
Private Instance Methods
key(credentials, path, params = {})
click to toggle source
@see {LucidShopify::Client#get}
# File lib/lucid_shopify/cached_get.rb, line 41 def key(credentials, path, params = {}) Digest::MD5.hexdigest([ credentials.myshopify_domain, path, params, ].join("\x1f")) # ASCII unit separator end