Class: Unit::Account::Deposit::AccountOwnersRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/account/deposit/account_owners_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_id, customers) ⇒ AccountOwnersRequest

Returns a new instance of AccountOwnersRequest.

Parameters:

  • account_id (String)
  • customers (Array<String>)


14
15
16
17
# File 'lib/unit/models/account/deposit/account_owners_request.rb', line 14

def initialize(, customers)
  @account_id = 
  @customers = customers
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



10
11
12
# File 'lib/unit/models/account/deposit/account_owners_request.rb', line 10

def 
  @account_id
end

#customersObject (readonly)

Returns the value of attribute customers.



10
11
12
# File 'lib/unit/models/account/deposit/account_owners_request.rb', line 10

def customers
  @customers
end

Instance Method Details

#to_json_apiObject



19
20
21
22
23
24
25
# File 'lib/unit/models/account/deposit/account_owners_request.rb', line 19

def to_json_api
  customers_hash = customers.map do |customer|
    { "type": "customer", "id": customer }
  end
  result = { data: customers_hash }
  result.to_json
end