Module: EzpayInvoice::Api::Properties::Item

Included in:
EzpayInvoice::Api::Payloads::AllowanceIssue, EzpayInvoice::Api::Payloads::InvoiceIssue
Defined in:
lib/ezpay-invoice/api/properties/item.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/ezpay-invoice/api/properties/item.rb', line 5

def self.included(base)
  base.class_eval do
    property(
      :ItemName,
      from: :item_name,
      with: ->(value) { value.join('|') },
      required: true
    )
    property(
      :ItemCount,
      from: :item_count,
      with: ->(value) { value.join('|') },
      required: true
    )
    property(
      :ItemUnit,
      from: :item_unit,
      with: ->(value) { value.join('|') },
      required: true
    )
    property(
      :ItemPrice,
      from: :item_price,
      with: ->(value) { value.join('|') },
      required: true
    )
    property(
      :ItemAmt,
      from: :item_amt,
      with: ->(value) { value.join('|') },
      required: true
    )
  end
end