Class: Firebase::Admin::Auth::UserInfo
- Inherits:
-
Object
- Object
- Firebase::Admin::Auth::UserInfo
- Defined in:
- lib/firebase/admin/auth/user_info.rb
Overview
Standard profile information for a user.
Also used to expose profile information returned by an identity provider.
Direct Known Subclasses
Instance Method Summary collapse
-
#display_name ⇒ Object
Gets the display name of this user.
-
#email ⇒ Object
Gets the email address associated with this user.
-
#initialize(data) ⇒ UserInfo
constructor
Constructs a new UserInfo.
-
#phone_number ⇒ Object
Gets the phone number associated with this user.
-
#photo_url ⇒ Object
Gets the photo url of this user.
-
#provider_id ⇒ Object
Gets the id of the identity provider.
-
#to_h ⇒ Hash
Converts the object into a hash.
-
#uid ⇒ Object
Gets the ID of this user.
Constructor Details
#initialize(data) ⇒ UserInfo
Constructs a new UserInfo.
14 15 16 |
# File 'lib/firebase/admin/auth/user_info.rb', line 14 def initialize(data) @data = data || {} end |
Instance Method Details
#display_name ⇒ Object
Gets the display name of this user.
24 25 26 |
# File 'lib/firebase/admin/auth/user_info.rb', line 24 def display_name @data["displayName"] end |
#email ⇒ Object
Gets the email address associated with this user.
29 30 31 |
# File 'lib/firebase/admin/auth/user_info.rb', line 29 def email @data["email"] end |
#phone_number ⇒ Object
Gets the phone number associated with this user.
34 35 36 |
# File 'lib/firebase/admin/auth/user_info.rb', line 34 def phone_number @data["phoneNumber"] end |
#photo_url ⇒ Object
Gets the photo url of this user.
39 40 41 |
# File 'lib/firebase/admin/auth/user_info.rb', line 39 def photo_url @data["photoUrl"] end |
#provider_id ⇒ Object
Gets the id of the identity provider.
This can be a short domain name (e.g. google.com), or the identity of an OpenID identity provider.
47 48 49 |
# File 'lib/firebase/admin/auth/user_info.rb', line 47 def provider_id @data["providerId"] end |
#to_h ⇒ Hash
Converts the object into a hash.
54 55 56 |
# File 'lib/firebase/admin/auth/user_info.rb', line 54 def to_h @data.dup end |
#uid ⇒ Object
Gets the ID of this user.
19 20 21 |
# File 'lib/firebase/admin/auth/user_info.rb', line 19 def uid @data["rawId"] end |