Module: Legion::Extensions::Helpers::Cache

Includes:
Base
Defined in:
lib/legion/extensions/helpers/cache.rb

Instance Method Summary collapse

Methods included from Base

#actor_class, #actor_const, #actor_name, #calling_class, #calling_class_array, #from_json, #full_path, #lex_class, #lex_const, #lex_name, #normalize, #runner_class, #runner_const, #runner_name, #to_dotted_hash

Instance Method Details

#cache_get(key) ⇒ Object



17
18
19
# File 'lib/legion/extensions/helpers/cache.rb', line 17

def cache_get(key)
  Legion::Cache.get(cache_namespace + key)
end

#cache_namespaceObject



9
10
11
# File 'lib/legion/extensions/helpers/cache.rb', line 9

def cache_namespace
  @cache_namespace ||= lex_name
end

#cache_set(key, value, ttl: 60) ⇒ Object



13
14
15
# File 'lib/legion/extensions/helpers/cache.rb', line 13

def cache_set(key, value, ttl: 60, **)
  Legion::Cache.set(cache_namespace + key, value, ttl: ttl)
end