lib/rescuetime/client.rb
def valid_credentials?
      return false unless api_key?
      !activities.all.nil?
    rescue Rescuetime::Errors::InvalidCredentialsError
      false
    end
def valid_credentials?
      return false unless api_key?
      !activities.all.nil?
    rescue Rescuetime::Errors::InvalidCredentialsError
      false
    end
Returns true if the provided api key is valid. Performs a request to the
 Rescuetime API.

 @example Basic Use
   # Assuming that INVALID_KEY is an invalid Rescuetime API key
   # and VALID_KEY is a valid one

   client = Rescuetime::Client
   client.valid_credentials?
   # => false

   client.api_key = INVALID_KEY
   client.valid_credentials? # Performs a request to the Rescuetime API
   # => false

   client.api_key = VALID_KEY
   client.valid_credentials? # Performs a request to the Rescuetime API
   # => true

 @return [Boolean]