Class: FdxV660Api::DebitCreditMemo
- Inherits:
-
Object
- Object
- FdxV660Api::DebitCreditMemo
- Defined in:
- lib/fdx_v660_api/models/debit_credit_memo.rb
Overview
The posting type of a transaction
Constant Summary collapse
- DEBIT_CREDIT_MEMO =
[ # TODO: Write general description for CREDIT CREDIT = 'CREDIT'.freeze, # TODO: Write general description for DEBIT DEBIT = 'DEBIT'.freeze, # TODO: Write general description for MEMO MEMO = 'MEMO'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = CREDIT) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/fdx_v660_api/models/debit_credit_memo.rb', line 26 def self.from_value(value, default_value = CREDIT) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'credit' then CREDIT when 'debit' then DEBIT when 'memo' then MEMO else default_value end end |
.validate(value) ⇒ Object
20 21 22 23 24 |
# File 'lib/fdx_v660_api/models/debit_credit_memo.rb', line 20 def self.validate(value) return false if value.nil? true end |