lib/api_cache/api.rb
def queryable?(key, retry_time)
    if @query_times[key]
      if Time.now - @query_times[key] > retry_time
        APICache.logger.log "Queryable: true - retry_time has passed"
        true
      else
        APICache.logger.log "Queryable: false - queried too recently"
        false
      end
    else
      APICache.logger.log "Queryable: true - never used API before"
      true
    end
  end
# Checks whether the API can be queried (i.e. whether retry_time has passed
# since the last query to the API).
# 
# If retry_time is 0 then there is no limit on how frequently queries can
# be made to the API.
Checks whether the API can be queried .

If retry_time is 0 then there is no limit on how frequently queries can
be made to the API.
Checks whether the API can be queried . If retry_time is 0 then there is no limit on how frequently queries can be made to the API .
def queryable?(key, retry_time)
    if @query_times[key]
      if Time.now - @query_times[key] > retry_time
        APICache.logger.log "Queryable: true - retry_time has passed"
        true
      else
        APICache.logger.log "Queryable: false - queried too recently"
        false
      end
    else
      APICache.logger.log "Queryable: true - never used API before"
      true
    end
  end
def queryable? ( key , retry_time ) if @query_times [ key ] if Time . now - @query_times [ key ] > retry_time APICache . logger . log "Queryable: true - retry_time has passed" true else APICache . logger . log "Queryable: false - queried too recently" false end else APICache . logger . log "Queryable: true - never used API before" true end end
Checks whether the API can be queried (i.e.
Checks whether the API can be queried ( i . e .
key
retry_time