Class: LockstepSdk::TransferOwnerModel
- Inherits:
-
Object
- Object
- LockstepSdk::TransferOwnerModel
- Defined in:
- lib/lockstep_sdk/models/transfer_owner_model.rb
Overview
Model from the transfer ownership process.
Instance Attribute Summary collapse
-
#new_owner ⇒ UserAccountModel
The new owner of the account.
-
#previous_owner ⇒ UserAccountModel
The previous owner of the account.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ TransferOwnerModel
constructor
Initialize the TransferOwnerModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
Constructor Details
#initialize(params = {}) ⇒ TransferOwnerModel
Initialize the TransferOwnerModel using the provided prototype
28 29 30 31 |
# File 'lib/lockstep_sdk/models/transfer_owner_model.rb', line 28 def initialize(params = {}) @previous_owner = params.dig(:previous_owner) @new_owner = params.dig(:new_owner) end |
Instance Attribute Details
#new_owner ⇒ UserAccountModel
Returns The new owner of the account.
39 40 41 |
# File 'lib/lockstep_sdk/models/transfer_owner_model.rb', line 39 def new_owner @new_owner end |
#previous_owner ⇒ UserAccountModel
Returns The previous owner of the account.
35 36 37 |
# File 'lib/lockstep_sdk/models/transfer_owner_model.rb', line 35 def previous_owner @previous_owner end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
43 44 45 46 47 48 |
# File 'lib/lockstep_sdk/models/transfer_owner_model.rb', line 43 def as_json(={}) { 'previousOwner' => @previous_owner, 'newOwner' => @new_owner, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
52 53 54 |
# File 'lib/lockstep_sdk/models/transfer_owner_model.rb', line 52 def to_json(*) "[#{as_json(*).to_json(*)}]" end |