Class: Firebase::Admin::Auth::UserInfo

Inherits:
Object
  • Object
show all
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

UserRecord

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ UserInfo

Constructs a new UserInfo.

Parameters:

  • data (Hash)

    A hash of profile information



14
15
16
# File 'lib/firebase/admin/auth/user_info.rb', line 14

def initialize(data)
  @data = data || {}
end

Instance Method Details

#display_nameObject

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

#emailObject

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_numberObject

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_urlObject

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_idObject

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_hHash

Converts the object into a hash.

Returns:

  • (Hash)


54
55
56
# File 'lib/firebase/admin/auth/user_info.rb', line 54

def to_h
  @data.dup
end

#uidObject

Gets the ID of this user.



19
20
21
# File 'lib/firebase/admin/auth/user_info.rb', line 19

def uid
  @data["rawId"]
end