Class: FastComments::SSO::SecureSSOUserData
- Inherits:
-
Object
- Object
- FastComments::SSO::SecureSSOUserData
- Defined in:
- lib/fastcomments/sso/secure_sso_user_data.rb
Instance Attribute Summary collapse
-
#avatar ⇒ Object
Returns the value of attribute avatar.
-
#email ⇒ Object
Returns the value of attribute email.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #as_json_base64 ⇒ Object
-
#initialize(user_id:, email:, username:, avatar:) ⇒ SecureSSOUserData
constructor
A new instance of SecureSSOUserData.
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(user_id:, email:, username:, avatar:) ⇒ SecureSSOUserData
Returns a new instance of SecureSSOUserData.
9 10 11 12 13 14 |
# File 'lib/fastcomments/sso/secure_sso_user_data.rb', line 9 def initialize(user_id:, email:, username:, avatar:) @user_id = user_id @email = email @username = username @avatar = avatar end |
Instance Attribute Details
#avatar ⇒ Object
Returns the value of attribute avatar.
7 8 9 |
# File 'lib/fastcomments/sso/secure_sso_user_data.rb', line 7 def avatar @avatar end |
#email ⇒ Object
Returns the value of attribute email.
7 8 9 |
# File 'lib/fastcomments/sso/secure_sso_user_data.rb', line 7 def email @email end |
#user_id ⇒ Object
Returns the value of attribute user_id.
7 8 9 |
# File 'lib/fastcomments/sso/secure_sso_user_data.rb', line 7 def user_id @user_id end |
#username ⇒ Object
Returns the value of attribute username.
7 8 9 |
# File 'lib/fastcomments/sso/secure_sso_user_data.rb', line 7 def username @username end |
Instance Method Details
#as_json_base64 ⇒ Object
25 26 27 28 |
# File 'lib/fastcomments/sso/secure_sso_user_data.rb', line 25 def as_json_base64 json_str = to_json Base64.strict_encode64(json_str) end |
#to_json(*args) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/fastcomments/sso/secure_sso_user_data.rb', line 16 def to_json(*args) { user_id: @user_id, email: @email, username: @username, avatar: @avatar }.to_json(*args) end |