def authorize(options = {})
      type = options.delete(:type) || :site
      
      options[:redirect_uri] ||= VkontakteApi.redirect_uri
      
      case type
      when :site
        code  = options.delete(:code)
        token = client.auth_code.get_token(code, options)
      when :app_server
        token = client.client_credentials.get_token(options, OPTIONS[:client_credentials].dup)
      else
        raise ArgumentError, "Unknown authorization type #{type.inspect}"
      end
      
      Client.new(token)
    end
def authorize(options = {})
      type = options.delete(:type) || :site
      
      options[:redirect_uri] ||= VkontakteApi.redirect_uri
      
      case type
      when :site
        code  = options.delete(:code)
        token = client.auth_code.get_token(code, options)
      when :app_server
        token = client.client_credentials.get_token(options, OPTIONS[:client_credentials].dup)
      else
        raise ArgumentError, "Unknown authorization type #{type.inspect}"
      end
      
      Client.new(token)
    end
Authorization (getting the access token and building a `VkontakteApi::Client` with it).
 @option options [Symbol] :type The type of authorization being used (`:site` and `:app_server` supported).
 @option options [String] :code The code to exchange for an access token (for `:site` authorization type).
 @raise [ArgumentError] raises after receiving an unknown authorization type.
 @return [VkontakteApi::Client] An API client.