Class: LockstepSdk::InviteModel
- Inherits:
-
Object
- Object
- LockstepSdk::InviteModel
- Defined in:
- lib/lockstep_sdk/models/invite_model.rb
Overview
Model from the User invite process
Instance Attribute Summary collapse
-
#email ⇒ String
The invited email address.
-
#error_message ⇒ String
The error message if the invite was not successful.
-
#invited_user ⇒ UserAccountModel
The invited user, may be null if the user could not be invited.
-
#success ⇒ Boolean
True if the invite was sent successfully.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ InviteModel
constructor
Initialize the InviteModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
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
#email ⇒ String
Returns The invited email address.
37 38 39 |
# File 'lib/lockstep_sdk/models/invite_model.rb', line 37 def email @email end |
#error_message ⇒ String
Returns 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 end |
#invited_user ⇒ UserAccountModel
Returns 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 |
#success ⇒ Boolean
Returns 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.
53 54 55 56 57 58 59 60 |
# File 'lib/lockstep_sdk/models/invite_model.rb', line 53 def as_json(={}) { 'email' => @email, 'success' => @success, 'invitedUser' => @invited_user, 'errorMessage' => @error_message, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
64 65 66 |
# File 'lib/lockstep_sdk/models/invite_model.rb', line 64 def to_json(*) "[#{as_json(*).to_json(*)}]" end |