git.s-ol.nu mmm / 0cc0b9d mmm / mmmfs / cache.moon
0cc0b9d

Tree @0cc0b9d (Download .tar.gz)

cache.moon @0cc0b9draw · history · blame

class Cache
  new: =>
    @cache = {}

  get: (fileder, key) =>
    key = tostring key
    @cache[fileder.path] or= {}
    @cache[fileder.path][key]

  set: (fileder, key, val) =>
    key = tostring key
    @cache[fileder.path] or= {}
    @cache[fileder.path][key] = val


init_cache = ->
  export CACHE
  CACHE = Cache!

{
  :init_cache
}