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
26 27 28 29 |
# File 'lib/lockstep_sdk/models/transfer_owner_model.rb', line 26 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.
34 35 36 |
# File 'lib/lockstep_sdk/models/transfer_owner_model.rb', line 34 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.
37 38 39 40 41 42 |
# File 'lib/lockstep_sdk/models/transfer_owner_model.rb', line 37 def as_json(={}) { 'previousOwner' => @previous_owner, 'newOwner' => @new_owner, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
45 46 47 |
# File 'lib/lockstep_sdk/models/transfer_owner_model.rb', line 45 def to_json(*) "[#{as_json(*).to_json(*)}]" end |