Class: LockstepSdk::InviteModel

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

Overview

Model from the User invite process

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ InviteModel

Initialize the InviteModel using the provided prototype



26
27
28
29
30
31
# File 'lib/lockstep_sdk/models/invite_model.rb', line 26

def initialize(params = {})
    @email = params.dig(:email)
    @success = params.dig(:success)
    @invited_user = params.dig(:invited_user)
    @error_message = params.dig(:error_message)
end

Instance Attribute Details

#emailString

Returns The invited email address.

Returns:

  • (String)

    The invited email address



34
35
36
# File 'lib/lockstep_sdk/models/invite_model.rb', line 34

def email
  @email
end

#error_messageString

Returns The error message if the invite was not successful.

Returns:

  • (String)

    The error message if the invite was not successful



40
41
42
# File 'lib/lockstep_sdk/models/invite_model.rb', line 40

def error_message
  @error_message
end

#invited_userUserAccountModel

Returns The invited user, may be null if the user could not be invited.

Returns:

  • (UserAccountModel)

    The invited user, may be null if the user could not be invited



38
39
40
# File 'lib/lockstep_sdk/models/invite_model.rb', line 38

def invited_user
  @invited_user
end

#successBoolean

Returns True if the invite was sent successfully.

Returns:

  • (Boolean)

    True if the invite was sent successfully



36
37
38
# File 'lib/lockstep_sdk/models/invite_model.rb', line 36

def success
  @success
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



43
44
45
46
47
48
49
50
# File 'lib/lockstep_sdk/models/invite_model.rb', line 43

def as_json(options={})
    {
        'email' => @email,
        'success' => @success,
        'invitedUser' => @invited_user,
        'errorMessage' => @error_message,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



53
54
55
# File 'lib/lockstep_sdk/models/invite_model.rb', line 53

def to_json(*options)
    "[#{as_json(*options).to_json(*options)}]"
end