 
 
   setLink: (path, source, cb) ->
-    console.log path, source
     @linkValue(path, source)
     try
       JSON.stringify(@getValue(path))

    return cb("key required") unless k
    d = @getValue(path)
    d.value = data
    @client.hset(VALUES_KEY, k, @data.vals[k], cb)


  getKeys: (path) ->

      @loadValues(data)
      @client.hgetall LINKS_KEY, (err, data) =>
        @loadLinks(data)
        console.log "data loaded"
        @ready = true

  loadValues: (data) ->
    return unless data
    for k, j of data
      @data.vals[k] = JSON.parse(j)

  loadLinks: (data) ->
    return unless data
    for k, j of data
      @data.links[k] = j
    for l, s of @data.links
      @linkValue(l, s)

