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.
28 29 30 31 32 33 34 |
# File 'lib/gdata/client/youtube.rb', line 28 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.
26 27 28 |
# File 'lib/gdata/client/youtube.rb', line 26 def client_id @client_id end |
#developer_key ⇒ Object
The YouTube developer key being used.
24 25 26 |
# File 'lib/gdata/client/youtube.rb', line 24 def developer_key @developer_key end |
Instance Method Details
#prepare_headers ⇒ Object
Custom prepare_headers to include the developer key and clientID
37 38 39 40 41 42 43 44 45 |
# File 'lib/gdata/client/youtube.rb', line 37 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 |