Class: Unit::Transaction::PatchBookTransactionRequest
- Inherits:
-
Object
- Object
- Unit::Transaction::PatchBookTransactionRequest
- Defined in:
- lib/unit/models/transaction/patch_book_transaction_request.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#transaction_id ⇒ Object
readonly
Returns the value of attribute transaction_id.
Instance Method Summary collapse
-
#initialize(account_id, transaction_id, summary = nil, tags = nil) ⇒ PatchBookTransactionRequest
constructor
A new instance of PatchBookTransactionRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(account_id, transaction_id, summary = nil, tags = nil) ⇒ PatchBookTransactionRequest
Returns a new instance of PatchBookTransactionRequest.
14 15 16 17 18 19 |
# File 'lib/unit/models/transaction/patch_book_transaction_request.rb', line 14 def initialize(account_id, transaction_id, summary = nil, = nil) @account_id = account_id @transaction_id = transaction_id @summary = summary @tags = end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
8 9 10 |
# File 'lib/unit/models/transaction/patch_book_transaction_request.rb', line 8 def account_id @account_id end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
8 9 10 |
# File 'lib/unit/models/transaction/patch_book_transaction_request.rb', line 8 def summary @summary end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/unit/models/transaction/patch_book_transaction_request.rb', line 8 def @tags end |
#transaction_id ⇒ Object (readonly)
Returns the value of attribute transaction_id.
8 9 10 |
# File 'lib/unit/models/transaction/patch_book_transaction_request.rb', line 8 def transaction_id @transaction_id end |
Instance Method Details
#to_json_api ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/unit/models/transaction/patch_book_transaction_request.rb', line 21 def to_json_api payload = { data: { type: "bookTransaction", attributes: { summary: summary, tags: }, relationships: { account: Unit::Types::Relationship.new("account", account_id).to_hash } } } payload[:data][:attributes].compact! payload.to_json end |