   # Create a single instance of TickerTask
   @instance: new @()
 
-  @reset: () ->
-    @instance = new @
+  @reset: -> @instance = new @
 
-  onStart: () ->
+  onStart: ->
     super
     @_updateTicker yes
 


  _cache: {}
  _chromeStore: new ledger.storage.ChromeStore('ticker')
  #chromeStore.get 'ticker_cache', (r) =>
  # _cache = r.ticker_cache?

  get: () ->
    return @_cache

  set: (currencies) ->
    @_cache = currencies
    @_chromeStore.set {ticker_cache: currencies}

  isCacheEmpty: () ->
    _.isEmpty(@_cache)


###

    return unless @isRunning()
    @_currenciesRestClient.getAllCurrencies (currencies) =>
      @_cache.set(currencies) if currencies?
      #5 minutes * 60 seconds * 1000 milliseconds = 300000ms
      setTimeout((() => @updateTicker()), 300000) if scheduleNext
      @emit 'updated', @_cache.get() if currencies?

  getCache: -> @_cache.get()

  getCacheAsync: (callback=undefined) ->
    if @_cache.isCacheEmpty()
