def validate(expiration_buffer_sec = 0)
      return true if (Time.now + expiration_buffer_sec).to_i < expires_on
      unless refresh_token
        logger.verbose('Cached token is almost expired but no refresh token ' \
                       'is available.')
        return false
      end
      logger.verbose('Cached token is almost expired, attempting to refresh ' \
                     ' with refresh token.')
      refresh_response = refresh
      if refresh_response.instance_of? SuccessResponse
        logger.verbose('Successfully refreshed token in cache.')
        @token_response = refresh_response
        true
      else
        logger.warn('Failed to refresh token in cache with refresh token.')
        false
      end
    end
def validate(expiration_buffer_sec = 0)
      return true if (Time.now + expiration_buffer_sec).to_i < expires_on
      unless refresh_token
        logger.verbose('Cached token is almost expired but no refresh token ' \
                       'is available.')
        return false
      end
      logger.verbose('Cached token is almost expired, attempting to refresh ' \
                     ' with refresh token.')
      refresh_response = refresh
      if refresh_response.instance_of? SuccessResponse
        logger.verbose('Successfully refreshed token in cache.')
        @token_response = refresh_response
        true
      else
        logger.warn('Failed to refresh token in cache with refresh token.')
        false
      end
    end
If the access token is within the expiration buffer of expiring, an
 attempt will be made to retrieve a new token with the refresh token.

 @param Fixnum expiration_buffer_sec
   The number of seconds to use as leeway in determining if the token is
   expired. A positive buffer will refresh the token early while a negative
   buffer will refresh it late. Used to counter clock skew and network
   latency.
 @return Boolean
   True if the token is still valid (even if it was refreshed). False if
   the token is expired an unable to be refreshed.