Class: Firebase::Admin::Auth::UserRecord
- Defined in:
- lib/firebase/admin/auth/user_record.rb
Overview
A Firebase User account
Instance Method Summary collapse
-
#custom_claims ⇒ Object
Gets any custom claims set on this user account.
- #disabled? ⇒ Boolean
- #email_verified? ⇒ Boolean
-
#provider_data ⇒ Array of UserInfo
Gets a list of (UserInfo) instances.
-
#provider_id ⇒ Object
Gets the id of the identity provider.
-
#tenant_id ⇒ Object
Returns the tenant ID of this user.
-
#tokens_valid_after_timestamp ⇒ Numeric
Gets the time, in milliseconds since the epoch, before which tokens are invalid.
-
#uid ⇒ Object
Gets the ID of this user.
-
#user_metadata ⇒ UserMetadata
Gets additional metadata associated with this user.
Methods inherited from UserInfo
#display_name, #email, #initialize, #phone_number, #photo_url, #to_h
Constructor Details
This class inherits a constructor from Firebase::Admin::Auth::UserInfo
Instance Method Details
#custom_claims ⇒ Object
Gets any custom claims set on this user account.
57 58 59 60 61 |
# File 'lib/firebase/admin/auth/user_record.rb', line 57 def custom_claims claims = @data["customAttributes"] parsed = JSON.parse(claims) unless claims.nil? parsed if parsed.is_a?(Hash) && !parsed.empty? end |
#disabled? ⇒ Boolean
24 25 26 |
# File 'lib/firebase/admin/auth/user_record.rb', line 24 def disabled? !!@data["disabled"] end |
#email_verified? ⇒ Boolean
20 21 22 |
# File 'lib/firebase/admin/auth/user_record.rb', line 20 def email_verified? !!@data["emailVerified"] end |
#provider_data ⇒ Array of UserInfo
Gets a list of (UserInfo) instances.
Each object represents an identity from an identity provider that is linked to this user.
51 52 53 54 |
# File 'lib/firebase/admin/auth/user_record.rb', line 51 def provider_data providers = @data["providerUserInfo"] || [] providers.to_a.map { |p| UserInfo.new(p) } end |
#provider_id ⇒ Object
Gets the id of the identity provider.
Always firebase for user accounts.
16 17 18 |
# File 'lib/firebase/admin/auth/user_record.rb', line 16 def provider_id "firebase" end |
#tenant_id ⇒ Object
Returns the tenant ID of this user.
64 65 66 |
# File 'lib/firebase/admin/auth/user_record.rb', line 64 def tenant_id raise NotImplementedError end |
#tokens_valid_after_timestamp ⇒ Numeric
truncated to 1 second accuracy.
Gets the time, in milliseconds since the epoch, before which tokens are invalid.
35 36 37 |
# File 'lib/firebase/admin/auth/user_record.rb', line 35 def raise NotImplementedError end |
#uid ⇒ Object
Gets the ID of this user.
9 10 11 |
# File 'lib/firebase/admin/auth/user_record.rb', line 9 def uid @data["localId"] end |
#user_metadata ⇒ UserMetadata
Gets additional metadata associated with this user.
42 43 44 |
# File 'lib/firebase/admin/auth/user_record.rb', line 42 def raise NotImplementedError end |