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
25 26 27 28 |
# File 'lib/lockstep_sdk/models/transfer_owner_model.rb', line 25 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.
36 37 38 |
# File 'lib/lockstep_sdk/models/transfer_owner_model.rb', line 36 def new_owner @new_owner end |
#previous_owner ⇒ UserAccountModel
Returns The previous owner of the account.
32 33 34 |
# File 'lib/lockstep_sdk/models/transfer_owner_model.rb', line 32 def previous_owner @previous_owner end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
40 41 42 43 44 45 |
# File 'lib/lockstep_sdk/models/transfer_owner_model.rb', line 40 def as_json(={}) { 'previousOwner' => @previous_owner, 'newOwner' => @new_owner, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
49 50 51 |
# File 'lib/lockstep_sdk/models/transfer_owner_model.rb', line 49 def to_json(*) "[#{as_json(*options).to_json(*options)}]" end |