def method_missing(api, *args)
      unless GoogleAPI.discovered_apis.has_key?(api)
        GoogleAPI.logger.info "Discovering the #{api} Google API..."
        response = access_token.get("https://www.googleapis.com/discovery/v1/apis?preferred=true&name=#{api}").parsed['items']
        super unless response # Raise a NoMethodError if Google's Discovery API does not return a good response
        discovery_url = response.first['discoveryRestUrl']
        GoogleAPI.discovered_apis[api] = access_token.get(discovery_url).parsed
      end

      API.new(access_token, api, GoogleAPI.discovered_apis[api]['resources'])
    end
def method_missing(api, *args)
      unless GoogleAPI.discovered_apis.has_key?(api)
        GoogleAPI.logger.info "Discovering the #{api} Google API..."
        response = access_token.get("https://www.googleapis.com/discovery/v1/apis?preferred=true&name=#{api}").parsed['items']
        super unless response # Raise a NoMethodError if Google's Discovery API does not return a good response
        discovery_url = response.first['discoveryRestUrl']
        GoogleAPI.discovered_apis[api] = access_token.get(discovery_url).parsed
      end

      API.new(access_token, api, GoogleAPI.discovered_apis[api]['resources'])
    end
We build the appropriate API here based on the method name passed to the Client.
 For example:

   User.find(1).google.drive

 We will then discover and cache the Google Drive API for future use.
 Any methods chained to the resultant API will then be passed along to the
 instantiaed class. Read the documentation for GoogleAPI::API#method_missing for
 more information.