Class: Yoti::ActivityDetails
- Inherits:
-
Object
- Object
- Yoti::ActivityDetails
- Defined in:
- lib/yoti/activity_details.rb
Overview
Details of an activity between a user and the application.
Instance Attribute Summary collapse
-
#age_verified ⇒ Boolean
readonly
deprecated
Deprecated.
2.0.0 - replaced by:
-
#base64_selfie_uri ⇒ String
readonly
Base64 encoded selfie image.
-
#extra_data ⇒ ExtraData
readonly
Extra data.
-
#outcome ⇒ String
readonly
The outcome of the profile request, eg: SUCCESS.
-
#parent_remember_me_id ⇒ String
readonly
Return the Parent Remember Me ID, which is a unique, stable identifier for a user in the context of an organisation.
-
#receipt_id ⇒ String
readonly
Receipt ID identifying a completed activity.
-
#remember_me_id ⇒ String
readonly
Return the Remember Me ID, which is a unique, stable identifier for a user in the context of an application.
-
#timestamp ⇒ Time
readonly
Time and date of the sharing activity.
-
#user_id ⇒ String
readonly
deprecated
Deprecated.
replaced by :remember_me_id
-
#user_profile ⇒ Hash
readonly
deprecated
Deprecated.
replaced by :profile
Instance Method Summary collapse
-
#application_profile ⇒ ApplicationProfile
Profile of an application, with convenience methods to access well-known attributes.
-
#initialize(receipt, decrypted_profile = nil, decrypted_application_profile = nil, extra_data = nil) ⇒ ActivityDetails
constructor
A new instance of ActivityDetails.
-
#profile ⇒ Profile
The user profile with shared attributes and anchor information, returned by Yoti if the request was successful.
-
#structured_postal_address ⇒ Hash
deprecated
Deprecated.
replaced by Yoti::Profile#structured_postal_address
Constructor Details
#initialize(receipt, decrypted_profile = nil, decrypted_application_profile = nil, extra_data = nil) ⇒ ActivityDetails
Returns a new instance of ActivityDetails.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/yoti/activity_details.rb', line 101 def initialize(receipt, decrypted_profile = nil, decrypted_application_profile = nil, extra_data = nil) @remember_me_id = receipt['remember_me_id'] @user_id = @remember_me_id @receipt_id = receipt['receipt_id'] @parent_remember_me_id = receipt['parent_remember_me_id'] @outcome = receipt['sharing_outcome'] = receipt['timestamp'] ? Time.parse(receipt['timestamp']) : nil @extended_user_profile = process_decrypted_profile(decrypted_profile) @extended_application_profile = process_decrypted_profile(decrypted_application_profile) @extra_data = extra_data @user_profile = @extended_user_profile.map do |name, attribute| [name, attribute.value] end.to_h end |
Instance Attribute Details
#age_verified ⇒ Boolean (readonly)
2.0.0 - replaced by:
The age under/over attribute
-
Yoti::Profile#age_verifications
-
Yoti::Profile#find_age_over_verification
-
Yoti::Profile#find_age_under_verification
71 72 73 |
# File 'lib/yoti/activity_details.rb', line 71 def age_verified @age_verified end |
#base64_selfie_uri ⇒ String (readonly)
Base64 encoded selfie image
59 60 61 |
# File 'lib/yoti/activity_details.rb', line 59 def base64_selfie_uri @base64_selfie_uri end |
#extra_data ⇒ ExtraData (readonly)
Extra data
92 93 94 |
# File 'lib/yoti/activity_details.rb', line 92 def extra_data @extra_data end |
#outcome ⇒ String (readonly)
The outcome of the profile request, eg: SUCCESS
14 15 16 |
# File 'lib/yoti/activity_details.rb', line 14 def outcome @outcome end |
#parent_remember_me_id ⇒ String (readonly)
Return the Parent Remember Me ID, which is a unique, stable identifier for a user in the context of an organisation.
You can use it to identify returning users. This value is consistent for a given user across different applications belonging to a single organisation.
43 44 45 |
# File 'lib/yoti/activity_details.rb', line 43 def parent_remember_me_id @parent_remember_me_id end |
#receipt_id ⇒ String (readonly)
Receipt ID identifying a completed activity
78 79 80 |
# File 'lib/yoti/activity_details.rb', line 78 def receipt_id @receipt_id end |
#remember_me_id ⇒ String (readonly)
Return the Remember Me ID, which is a unique, stable identifier for a user in the context of an application.
You can use it to identify returning users. This value will be different for the same user in different applications.
32 33 34 |
# File 'lib/yoti/activity_details.rb', line 32 def remember_me_id @remember_me_id end |
#timestamp ⇒ Time (readonly)
Time and date of the sharing activity
85 86 87 |
# File 'lib/yoti/activity_details.rb', line 85 def end |
#user_id ⇒ String (readonly)
replaced by :remember_me_id
21 22 23 |
# File 'lib/yoti/activity_details.rb', line 21 def user_id @user_id end |
#user_profile ⇒ Hash (readonly)
replaced by :profile
The decoded profile attributes
52 53 54 |
# File 'lib/yoti/activity_details.rb', line 52 def user_profile @user_profile end |
Instance Method Details
#application_profile ⇒ ApplicationProfile
Profile of an application, with convenience methods to access well-known attributes
142 143 144 |
# File 'lib/yoti/activity_details.rb', line 142 def application_profile Yoti::ApplicationProfile.new(@extended_application_profile) end |
#profile ⇒ Profile
The user profile with shared attributes and anchor information, returned by Yoti if the request was successful
133 134 135 |
# File 'lib/yoti/activity_details.rb', line 133 def profile Yoti::Profile.new(@extended_user_profile) end |
#structured_postal_address ⇒ Hash
replaced by Yoti::Profile#structured_postal_address
The user’s structured postal address as JSON
123 124 125 |
# File 'lib/yoti/activity_details.rb', line 123 def structured_postal_address user_profile['structured_postal_address'] end |