Class: Unit::CheckDeposit::PatchDepositRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/check_deposit/patch_deposit_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(deposit_id, tags) ⇒ PatchDepositRequest

Returns a new instance of PatchDepositRequest.

Parameters:

  • deposit_id (String)
  • tags (Hash)
    • optional



12
13
14
15
# File 'lib/unit/models/check_deposit/patch_deposit_request.rb', line 12

def initialize(deposit_id, tags)
  @deposit_id = deposit_id
  @tags = tags
end

Instance Attribute Details

#deposit_idObject (readonly)

Returns the value of attribute deposit_id.



8
9
10
# File 'lib/unit/models/check_deposit/patch_deposit_request.rb', line 8

def deposit_id
  @deposit_id
end

#tagsObject (readonly)

Returns the value of attribute tags.



8
9
10
# File 'lib/unit/models/check_deposit/patch_deposit_request.rb', line 8

def tags
  @tags
end

Instance Method Details

#to_json_apiObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/unit/models/check_deposit/patch_deposit_request.rb', line 17

def to_json_api
  payload = {
    data: {
      type: "checkDeposit",
      attributes: { tags: tags }
    }
  }
  payload[:data][:attributes].compact!
  payload.to_json
end