Class: Yt::Models::UserInfo

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

Overview

Provides methods to retrieve an account’s user profile.

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

Constructor Details

#initialize(options = {}) ⇒ UserInfo

Returns a new instance of UserInfo.



8
9
10
# File 'lib/yt/models/user_info.rb', line 8

def initialize(options = {})
  @data = options[:data]
end

Instance Method Details

#avatar_urlString

Returns the URL of the user’s profile picture.

Returns:

  • (String)

    the URL of the user’s profile picture.



34
# File 'lib/yt/models/user_info.rb', line 34

has_attribute :avatar_url, from: :picture, default: ''

#emailString

Returns the user’s email address.

Returns:

  • (String)

    the user’s email address.



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

has_attribute :email, default: ''

#family_nameString

Returns the user’s family (last) name.

Returns:

  • (String)

    the user’s family (last) name.



28
# File 'lib/yt/models/user_info.rb', line 28

has_attribute :family_name, default: '', camelize: false

#genderString

Returns the person’s gender. Possible values include, but are not limited to, “male”, “female”, “other”.

Returns:

  • (String)

    the person’s gender. Possible values include, but are not limited to, “male”, “female”, “other”.



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

has_attribute :gender, default: ''

#given_nameString

Returns the user’s given (first) name.

Returns:

  • (String)

    the user’s given (first) name.



25
# File 'lib/yt/models/user_info.rb', line 25

has_attribute :given_name, default: '', camelize: false

#has_verified_email?Boolean

Returns whether the email address is verified.

Returns:

  • (Boolean)

    whether the email address is verified.



19
# File 'lib/yt/models/user_info.rb', line 19

has_attribute :has_verified_email?, from: :verified_email, default: false, camelize: false

#hdString

Returns the hosted domain name for the user’s Google Apps account. For instance, example.com.

Returns:

  • (String)

    the hosted domain name for the user’s Google Apps account. For instance, example.com.



45
# File 'lib/yt/models/user_info.rb', line 45

has_attribute :hd, default: ''

#idString

Returns the user’s ID.

Returns:

  • (String)

    the user’s ID.



13
# File 'lib/yt/models/user_info.rb', line 13

has_attribute :id, default: ''

#localeString

Returns the user’s preferred locale.

Returns:

  • (String)

    the user’s preferred locale.



41
# File 'lib/yt/models/user_info.rb', line 41

has_attribute :locale, default: ''

#nameString

Returns the user’s full name.

Returns:

  • (String)

    the user’s full name.



22
# File 'lib/yt/models/user_info.rb', line 22

has_attribute :name, default: ''

#profile_urlString

Returns the URL of the user’s profile page.

Returns:

  • (String)

    the URL of the user’s profile page.



31
# File 'lib/yt/models/user_info.rb', line 31

has_attribute :profile_url, from: :link, default: ''