class Leyline::Cache
- Leyline::Cache
- Reference
- Object
Defined in:
leyline/api/cats.crleyline/api/ids.cr
leyline/api/nodes.cr
leyline/api/quaggans.cr
leyline/api/titles.cr
leyline/api/worlds.cr
leyline/cache.cr
Instance Method Summary
- #cache_cat(cat : Cat, time = Time.now)
- #cache_cats(cats : Array(Cat))
- #cache_id_list(endpoint : String, ids : Array(String))
- #cache_nodes(nodes : Array(String))
- #cache_quaggan(quaggan : Quaggan, time = Time.now)
- #cache_quaggans(quaggans : Array(Quaggan))
- #cache_title(title : Title, time = Time.now)
- #cache_titles(titles : Array(Title))
- #cache_world(world : World, time = Time.now)
- #cache_worlds(worlds : Array(World))
- #cat(id : String) : Cat | Nil
- #cat(ids : Array(String)) : Array(Cat)
- #cats : Hash(String, {Time, Leyline::Cat})
- #id_list(endpoint : String)
- #ids : Hash(String, {Time, Array(String)})
-
#node(key : String)
Returns nil if the node cache is out of date
- #node_list
- #quaggan(id : String) : Quaggan | Nil
- #quaggan(ids : Array(String)) : Array(Quaggan)
- #quaggans : Hash(String, {Time, Leyline::Quaggan})
- #title(id : Int32) : Title | Nil
- #title(ids : Array(Int32)) : Array(Title)
- #titles : Hash(Int32, {Time, Leyline::Title})
- #world(id : String) : World | Nil
- #world(ids : Array(String)) : Array(World)
- #worlds : Hash(String, {Time, Leyline::World})
Macro Summary
-
generate_simple_cache(type, index_type)
This macro is for creating caches that are simple in nature and fall into a large umbrella of simple endpoints.
Instance Method Detail
Macro Detail
macro generate_simple_cache(type, index_type)
#
This macro is for creating caches that are simple in nature and fall into a large umbrella of simple endpoints.
It provides 4 methods, 2 for caching, and 2 for retreiving the cache data.
getter types
, type(id)
, cache_type(type)
, cache_types(Array(type))