Class: LockstepSdk::UserDataResponseModel
- Inherits:
-
Object
- Object
- LockstepSdk::UserDataResponseModel
- Defined in:
- lib/lockstep_sdk/models/user_data_response_model.rb
Overview
Contains data about the current user.
Instance Attribute Summary collapse
-
#data ⇒ Object
Data about the user, the properties returned will depend on the requested information.
-
#user_id ⇒ Uuid
The Lockstep Platform ID of the user.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ UserDataResponseModel
constructor
Initialize the UserDataResponseModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
Constructor Details
#initialize(params = {}) ⇒ UserDataResponseModel
Initialize the UserDataResponseModel using the provided prototype
25 26 27 28 |
# File 'lib/lockstep_sdk/models/user_data_response_model.rb', line 25 def initialize(params = {}) @data = params.dig(:data) @user_id = params.dig(:user_id) end |
Instance Attribute Details
#data ⇒ Object
Returns Data about the user, the properties returned will depend on the requested information.
32 33 34 |
# File 'lib/lockstep_sdk/models/user_data_response_model.rb', line 32 def data @data end |
#user_id ⇒ Uuid
Returns The Lockstep Platform ID of the user.
36 37 38 |
# File 'lib/lockstep_sdk/models/user_data_response_model.rb', line 36 def user_id @user_id end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
40 41 42 43 44 45 |
# File 'lib/lockstep_sdk/models/user_data_response_model.rb', line 40 def as_json(={}) { 'data' => @data, 'userId' => @user_id, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
49 50 51 |
# File 'lib/lockstep_sdk/models/user_data_response_model.rb', line 49 def to_json(*) "[#{as_json(*).to_json(*)}]" end |