Class: Unit::Account::Credit::FreezeAccountRequest
- Inherits:
-
Object
- Object
- Unit::Account::Credit::FreezeAccountRequest
- Defined in:
- lib/unit/models/account/credit/freeze_account_request.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#reason_text ⇒ Object
readonly
Returns the value of attribute reason_text.
Instance Method Summary collapse
-
#initialize(account_id, reason, reason_text = nil) ⇒ FreezeAccountRequest
constructor
A new instance of FreezeAccountRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(account_id, reason, reason_text = nil) ⇒ FreezeAccountRequest
Returns a new instance of FreezeAccountRequest.
14 15 16 17 18 |
# File 'lib/unit/models/account/credit/freeze_account_request.rb', line 14 def initialize(account_id, reason, reason_text = nil) @account_id = account_id @reason = reason @reason_text = reason_text end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
9 10 11 |
# File 'lib/unit/models/account/credit/freeze_account_request.rb', line 9 def account_id @account_id end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
9 10 11 |
# File 'lib/unit/models/account/credit/freeze_account_request.rb', line 9 def reason @reason end |
#reason_text ⇒ Object (readonly)
Returns the value of attribute reason_text.
9 10 11 |
# File 'lib/unit/models/account/credit/freeze_account_request.rb', line 9 def reason_text @reason_text end |
Instance Method Details
#to_json_api ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/unit/models/account/credit/freeze_account_request.rb', line 20 def to_json_api payload = { data: { type: "creditAccountFreeze", attributes: { reason: reason, reasonText: reason_text } } } payload[:data][:attributes].compact! payload.to_json end |