{"size": 740, "ext": "js", "max_stars_repo_path": "helpers/RedisSchema.js", "max_stars_repo_name": "nullivex/node-portal-skeleton", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "helpers/RedisSchema.js", "max_issues_repo_name": "nullivex/node-portal-skeleton", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "helpers/RedisSchema.js", "max_forks_repo_name": "nullivex/node-portal-skeleton", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 14.8, "max_line_length": 50, "alphanum_fraction": 0.65}
'use strict';



/**
 * Redis Key Schema
 * @param {string} prefix
 * @constructor
 */
var RedisSchema = function(prefix){
  if(!prefix) prefix = 'animegg'
  this.prefix = prefix
}


/**
 * Apply Key Prefix
 * @param {string} key
 * @return {string}
 */
RedisSchema.prototype.applyPrefix = function(key){
  return this.prefix + ':' + key
}


/**
 * Key used to flush db on prism start
 * @return {string}
 */
RedisSchema.prototype.flushKeys = function(){
  return this.applyPrefix('*')
}


/**
 * Look up a purchase
 * @param {string} sha1
 * @return {string}
 */
RedisSchema.prototype.purchase = function(sha1){
  return this.applyPrefix('purchase:' + sha1)
}


/**
 * Export Object
 * @type {RedisSchema}
 */
module.exports = RedisSchema
