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



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

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



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

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



49
50
51
# File 'lib/lockstep_sdk/models/invite_model.rb', line 49

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



45
46
47
# File 'lib/lockstep_sdk/models/invite_model.rb', line 45

def invited_user
  @invited_user
end

#successBoolean

Returns True if the invite was sent successfully.

Returns:

  • (Boolean)

    True if the invite was sent successfully



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

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



53
54
55
56
57
58
59
60
# File 'lib/lockstep_sdk/models/invite_model.rb', line 53

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



64
65
66
# File 'lib/lockstep_sdk/models/invite_model.rb', line 64

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