Class: Yt::Models::Account
Overview
Provides methods to interact with YouTube accounts.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#channel ⇒ Yt::Models::Channel
readonly
The account’s channel.
- #owner_name ⇒ String? readonly
-
#resumable_sessions ⇒ Yt::Collections::ResumableSessions
readonly
The sessions used to upload videos using the resumable upload protocol.
-
#user_info ⇒ Yt::Models::UserInfo
readonly
The account’s profile information.
-
#videos ⇒ Yt::Collections::Videos
readonly
The videos owned by the account.
Instance Method Summary collapse
-
#upload_video(path_or_url, params = {}) ⇒ Yt::Models::Video
Uploads a video.
Methods included from Associations::HasReports
Methods included from Associations::HasViewerPercentages
Methods included from Associations::HasOne
Methods included from Associations::HasMany
Methods included from Associations::HasAuthentication
Instance Attribute Details
#channel ⇒ Yt::Models::Channel (readonly)
Returns the account’s channel.
11 |
# File 'lib/yt/models/account.rb', line 11 has_one :channel |
#owner_name ⇒ String? (readonly)
26 27 28 |
# File 'lib/yt/models/account.rb', line 26 def owner_name @owner_name end |
#resumable_sessions ⇒ Yt::Collections::ResumableSessions (readonly)
Returns the sessions used to upload videos using the resumable upload protocol.
33 |
# File 'lib/yt/models/account.rb', line 33 has_many :resumable_sessions |
#user_info ⇒ Yt::Models::UserInfo (readonly)
Returns the account’s profile information.
16 |
# File 'lib/yt/models/account.rb', line 16 has_one :user_info |
#videos ⇒ Yt::Collections::Videos (readonly)
Returns the videos owned by the account.
22 |
# File 'lib/yt/models/account.rb', line 22 has_many :videos |
Instance Method Details
#upload_video(path_or_url, params = {}) ⇒ Yt::Models::Video
Uploads a video
44 45 46 47 48 |
# File 'lib/yt/models/account.rb', line 44 def upload_video(path_or_url, params = {}) file = open path_or_url, 'rb' session = resumable_sessions.insert file.size, params session.upload_video file end |