Class: LockstepSdk::UserDataResponseModel

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/models/user_data_response_model.rb

Overview

Contains data about the current user.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject

Returns Data about the user, the properties returned will depend on the requested information.

Returns:

  • (Object)

    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_idUuid

Returns The Lockstep Platform ID of the user.

Returns:

  • (Uuid)

    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.

Returns:

  • (object)

    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(options={})
    {
        'data' => @data,
        'userId' => @user_id,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    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(*options)
    "[#{as_json(*options).to_json(*options)}]"
end