Class: Yt::Models::Account

Inherits:
Base
  • Object
show all
Defined in:
lib/yt/models/account.rb

Overview

Provides methods to interact with YouTube accounts.

Direct Known Subclasses

ContentOwner

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Associations::HasReports

#has_report

Methods included from Associations::HasViewerPercentages

#has_viewer_percentages

Methods included from Associations::HasOne

#has_one

Methods included from Associations::HasMany

#has_many

Methods included from Associations::HasAuthentication

#has_authentication

Instance Attribute Details

#channelYt::Models::Channel (readonly)



11
# File 'lib/yt/models/account.rb', line 11

has_one :channel

#content_ownersYt::Collections::ContentOwners (readonly)



38
# File 'lib/yt/models/account.rb', line 38

has_many :content_owners

#owner_nameString? (readonly)



26
27
28
# File 'lib/yt/models/account.rb', line 26

def owner_name
  @owner_name
end

#resumable_sessionsYt::Collections::ResumableSessions (readonly)



33
# File 'lib/yt/models/account.rb', line 33

has_many :resumable_sessions

#user_infoYt::Models::UserInfo (readonly)



16
# File 'lib/yt/models/account.rb', line 16

has_one :user_info

#videosYt::Collections::Videos (readonly)



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

Options Hash (params):

  • :title (String)

    The video’s title.

  • :description (String)

    The video’s description.

  • :title (Array<String>)

    The video’s tags.

  • :privacy_status (String)

    The video’s privacy status.



49
50
51
52
53
# File 'lib/yt/models/account.rb', line 49

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