Sha256: c6edd1656618add7cd3cc53753164226095e691dfe24dd82e10eafa36b32c2dd

Contents?: true

Size: 523 Bytes

Versions: 2

Compression:

Stored size: 523 Bytes

Contents

#= require modularity/data/cache

# Provides fast and convenient retrieval of hash objects
# by indexing them on a given key column.
class modularity.IndexedCache

  constructor: (@key) ->
    @cache = new modularity.Cache


  add: (entry) ->
    @cache.add entry[@key], entry


  add_all: (entries) ->
    @add(entry) for entry in entries


  remove: (entry) ->
    @cache.remove entry[@key]


  remove_many: (entries) ->
    @cache.remove_many entries


  get: (key) ->
    @cache.get key


  length: => @cache.length()

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
modularity-rails-0.16.0 app/assets/javascripts/modularity/data/indexed_cache.coffee
modularity-coffee-rails-0.0.1 app/assets/javascripts/modularity/data/indexed_cache.coffee