Sha256: 1f59c978687483e6d1d10853ac853f825a89e03ada47b6fa80f6c61ac0fa12e7

Contents?: true

Size: 1.17 KB

Versions: 26

Compression:

Stored size: 1.17 KB

Contents

module TheCity

  # This adapter is the standard for all caching objects.
  class CacheAdapter

    # Constructor
    def initialize()
    end


    # Save data to the cache.
    #
    # * <b>key</b> The key to use to save the cache.
    # * <b>data</b> The JSON data to be saved.
    # * <b>expire_on (optional)</b> The datetime to expire the cache.
    #
    # Returns true on success or a string error message on false.
    def save_data(key, data, expire_on = nil)
      raise 'The save_data method must be implemented'
    end


    # Get the data from the cache.
    #
    # * <b>key</b> The key to use to get the cache.
    #
    # Returns the data for the key in the same way it was stored.
    def get_data(key)
      raise 'The get_data method must be implemented'
    end       


    # Expire the cache.
    #
    # * <b>key</b> The key to use to expire the cache.
    def expire_cache!(key)
      raise 'The expire_cache method must be implemented'
    end


    # Check if the cache has expired.
    #
    # * <b>key</b> The key to use to check if the cache has expired.
    def is_cache_expired?(key)
      raise 'The is_cache_expired method must be implemented'
    end  

  end

end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
the-city-admin-0.7.1 lib/cachers/cache_adapter.rb
the-city-admin-0.7.0 lib/cachers/cache_adapter.rb
the-city-admin-0.6.9 lib/cachers/cache_adapter.rb
the-city-admin-0.6.8 lib/cachers/cache_adapter.rb
the-city-admin-0.6.7 lib/cachers/cache_adapter.rb
the-city-admin-0.6.6 lib/cachers/cache_adapter.rb
the-city-admin-0.6.5 lib/cachers/cache_adapter.rb
the-city-admin-0.6.4 lib/cachers/cache_adapter.rb
the-city-admin-0.6.3 lib/cachers/cache_adapter.rb
the-city-admin-0.6.2 lib/cachers/cache_adapter.rb
the-city-admin-0.6.1 lib/cachers/cache_adapter.rb
the-city-admin-0.6.0 lib/cachers/cache_adapter.rb
the-city-admin-0.5.2 lib/cachers/cache_adapter.rb
the-city-admin-0.5.1 lib/cachers/cache_adapter.rb
the-city-admin-0.5.0 lib/cachers/cache_adapter.rb
the-city-admin-0.4.0 lib/cachers/cache_adapter.rb
the-city-admin-0.3.1 lib/cachers/cache_adapter.rb
the-city-admin-0.3.0 lib/cachers/cache_adapter.rb
the-city-admin-0.2.1 lib/cachers/cache_adapter.rb
the-city-admin-0.2.0 lib/cachers/cache_adapter.rb