Module: Taro::Types::Shared::Caching
- Defined in:
- lib/taro/types/shared/caching.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(klass) ⇒ Object
8 9 10 11 12 |
# File 'lib/taro/types/shared/caching.rb', line 8 def self.included(klass) klass.extend(ClassMethods) klass.singleton_class.attr_accessor :expires_in klass.singleton_class.attr_reader :cache_key end |
Instance Method Details
#cached_coerce_response ⇒ Object
2 3 4 5 6 |
# File 'lib/taro/types/shared/caching.rb', line 2 def cached_coerce_response Taro::Cache.call(object, cache_key: self.class.cache_key, expires_in: self.class.expires_in) do coerce_response end end |