Class: Unit::Account::Deposit::AccountOwnersRequest
- Inherits:
-
Object
- Object
- Unit::Account::Deposit::AccountOwnersRequest
- Defined in:
- lib/unit/models/account/deposit/account_owners_request.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#customers ⇒ Object
readonly
Returns the value of attribute customers.
Instance Method Summary collapse
-
#initialize(account_id, customers) ⇒ AccountOwnersRequest
constructor
A new instance of AccountOwnersRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(account_id, customers) ⇒ AccountOwnersRequest
Returns a new instance of AccountOwnersRequest.
14 15 16 17 |
# File 'lib/unit/models/account/deposit/account_owners_request.rb', line 14 def initialize(account_id, customers) @account_id = account_id @customers = customers end |
Instance Attribute Details
#account_id ⇒ Object (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 @account_id end |
#customers ⇒ Object (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_api ⇒ Object
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 |