Class: Yt::Models::UserInfo
Overview
Provides methods to retrieve an account’s user profile.
Instance Method Summary collapse
-
#avatar_url ⇒ String
The URL of the user’s profile picture.
-
#email ⇒ String
The user’s email address.
-
#family_name ⇒ String
The user’s family (last) name.
-
#gender ⇒ String
The person’s gender.
-
#given_name ⇒ String
The user’s given (first) name.
-
#has_verified_email? ⇒ Boolean
Whether the email address is verified.
-
#hd ⇒ String
The hosted domain name for the user’s Google Apps account.
-
#id ⇒ String
The user’s ID.
-
#initialize(options = {}) ⇒ UserInfo
constructor
A new instance of UserInfo.
-
#locale ⇒ String
The user’s preferred locale.
-
#name ⇒ String
The user’s full name.
-
#profile_url ⇒ String
The URL of the user’s profile page.
Methods included from Associations::HasReports
Methods included from Associations::HasOne
Methods included from Associations::HasMany
Methods included from Associations::HasAuthentication
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( = {}) @data = [:data] end |
Instance Method Details
#avatar_url ⇒ String
Returns the URL of the user’s profile picture.
48 49 50 |
# File 'lib/yt/models/user_info.rb', line 48 def avatar_url @avatar_url ||= @data.fetch 'picture', '' end |
#email ⇒ String
Returns the user’s email address.
18 19 20 |
# File 'lib/yt/models/user_info.rb', line 18 def email @email ||= @data.fetch 'email', '' end |
#family_name ⇒ String
Returns the user’s family (last) name.
38 39 40 |
# File 'lib/yt/models/user_info.rb', line 38 def family_name @family_name ||= @data.fetch 'family_name', '' end |
#gender ⇒ String
Returns the person’s gender. Possible values include, but are not limited to, “male”, “female”, “other”.
54 55 56 |
# File 'lib/yt/models/user_info.rb', line 54 def gender @gender ||= @data.fetch 'gender', '' end |
#given_name ⇒ String
Returns the user’s given (first) name.
33 34 35 |
# File 'lib/yt/models/user_info.rb', line 33 def given_name @given_name ||= @data.fetch 'given_name', '' end |
#has_verified_email? ⇒ Boolean
Returns whether the email address is verified.
23 24 25 |
# File 'lib/yt/models/user_info.rb', line 23 def has_verified_email? @verified_email ||= @data.fetch 'verified_email', false end |
#hd ⇒ String
Returns the hosted domain name for the user’s Google Apps account. For instance, example.com.
65 66 67 |
# File 'lib/yt/models/user_info.rb', line 65 def hd @hd ||= @data.fetch 'hd', '' end |
#id ⇒ String
Returns the user’s ID.
13 14 15 |
# File 'lib/yt/models/user_info.rb', line 13 def id @id ||= @data.fetch 'id', '' end |
#locale ⇒ String
Returns the user’s preferred locale.
59 60 61 |
# File 'lib/yt/models/user_info.rb', line 59 def locale @locale ||= @data.fetch 'locale', '' end |
#name ⇒ String
Returns the user’s full name.
28 29 30 |
# File 'lib/yt/models/user_info.rb', line 28 def name @name ||= @data.fetch 'name', '' end |
#profile_url ⇒ String
Returns the URL of the user’s profile page.
43 44 45 |
# File 'lib/yt/models/user_info.rb', line 43 def profile_url @profile_url ||= @data.fetch 'link', '' end |