class GData::Client::YouTube

Client class to wrap working with the YouTube API. Sets some YouTube-specific options.

Attributes

client_id[RW]

The YouTube ClientID being used.

developer_key[RW]

The YouTube developer key being used.

Public Class Methods

new(options = {}) click to toggle source
Calls superclass method GData::Client::Base.new
# File lib/gdata/client/youtube.rb, line 27
def initialize(options = {})
  options[:clientlogin_service] ||= 'youtube'
  options[:clientlogin_url] ||= 'https://www.google.com/youtube/accounts/ClientLogin'
  options[:authsub_scope] ||= 'http://gdata.youtube.com'
  options[:version] ||= '2'
  super(options)
end

Public Instance Methods

prepare_headers() click to toggle source

Custom #prepare_headers to include the developer key and clientID

Calls superclass method GData::Client::Base#prepare_headers
# File lib/gdata/client/youtube.rb, line 36
def prepare_headers
  if @client_id
    @headers['X-GData-Client'] = @client_id
  end
  if @developer_key
    @headers['X-GData-Key'] = "key=#{@developer_key}"
  end
  super
end