Class: GData::Client::YouTube
Overview
Client class to wrap working with the YouTube API. Sets some YouTube-specific options.
Instance Attribute Summary collapse
-
#client_id ⇒ Object
The YouTube ClientID being used.
-
#developer_key ⇒ Object
The YouTube developer key being used.
Attributes inherited from Base
#auth_handler, #authsub_scope, #clientlogin_service, #clientlogin_url, #headers, #http_service, #source, #version
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ YouTube
constructor
A new instance of YouTube.
-
#prepare_headers ⇒ Object
Custom prepare_headers to include the developer key and clientID.
Methods inherited from Base
#authsub_private_key=, #authsub_token=, #authsub_url, #clientlogin, #delete, #get, #make_file_request, #make_request, #post, #post_file, #put, #put_file
Constructor Details
#initialize(options = {}) ⇒ YouTube
Returns a new instance of YouTube.
27 28 29 30 31 32 33 |
# File 'lib/gdata/client/youtube.rb', line 27 def initialize( = {}) [:clientlogin_service] ||= 'youtube' [:clientlogin_url] ||= 'https://www.google.com/youtube/accounts/ClientLogin' [:authsub_scope] ||= 'http://gdata.youtube.com' [:version] ||= '2' super() end |
Instance Attribute Details
#client_id ⇒ Object
The YouTube ClientID being used.
25 26 27 |
# File 'lib/gdata/client/youtube.rb', line 25 def client_id @client_id end |
#developer_key ⇒ Object
The YouTube developer key being used.
23 24 25 |
# File 'lib/gdata/client/youtube.rb', line 23 def developer_key @developer_key end |
Instance Method Details
#prepare_headers ⇒ Object
Custom prepare_headers to include the developer key and clientID
36 37 38 39 40 41 42 43 44 |
# 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 |