Class: Unit::CashDeposit::GenerateBarcodeRequest
- Inherits:
-
Object
- Object
- Unit::CashDeposit::GenerateBarcodeRequest
- Defined in:
- lib/unit/models/cash_deposit/generate_barcode_request.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#store_id ⇒ Object
readonly
Returns the value of attribute store_id.
Instance Method Summary collapse
-
#initialize(store_id, account_id, customer_id) ⇒ GenerateBarcodeRequest
constructor
A new instance of GenerateBarcodeRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(store_id, account_id, customer_id) ⇒ GenerateBarcodeRequest
Returns a new instance of GenerateBarcodeRequest.
13 14 15 16 17 |
# File 'lib/unit/models/cash_deposit/generate_barcode_request.rb', line 13 def initialize(store_id, account_id, customer_id) @store_id = store_id @account_id = account_id @customer_id = customer_id end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
8 9 10 |
# File 'lib/unit/models/cash_deposit/generate_barcode_request.rb', line 8 def account_id @account_id end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
8 9 10 |
# File 'lib/unit/models/cash_deposit/generate_barcode_request.rb', line 8 def customer_id @customer_id end |
#store_id ⇒ Object (readonly)
Returns the value of attribute store_id.
8 9 10 |
# File 'lib/unit/models/cash_deposit/generate_barcode_request.rb', line 8 def store_id @store_id end |
Instance Method Details
#to_json_api ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/unit/models/cash_deposit/generate_barcode_request.rb', line 19 def to_json_api payload = { "data": { "type": "cashDepositBarcode", "attributes": { storeId: store_id }, "relationships": { "account": Unit::Types::Relationship.new("account", account_id).to_hash, "customer": Unit::Types::Relationship.new("customer", customer_id).to_hash } } } payload[:data][:attributes].compact! payload.to_json end |