Class: FdxV660Api::LineOfCreditTransactionType

Inherits:
Object
  • Object
show all
Defined in:
lib/fdx_v660_api/models/line_of_credit_transaction_type.rb

Overview

Defines the type of a line of credit transaction: * ADJUSTMENT: An adjustment or correction on the account * CHECK: A convenience check transaction, or convenience cheque in Canada * FEE: Fee charge. For example, a late payment fee * INTEREST: Interest charge * PAYMENT: A payment on the account * PURCHASE: A purchase transaction * WITHDRAWAL: A cash withdrawal transaction

Constant Summary collapse

LINE_OF_CREDIT_TRANSACTION_TYPE =
[
  # TODO: Write general description for ADJUSTMENT
  ADJUSTMENT = 'ADJUSTMENT'.freeze,

  # TODO: Write general description for CHECK
  CHECK = 'CHECK'.freeze,

  # TODO: Write general description for FEE
  FEE = 'FEE'.freeze,

  # TODO: Write general description for INTEREST
  INTEREST = 'INTEREST'.freeze,

  # TODO: Write general description for PAYMENT
  PAYMENT = 'PAYMENT'.freeze,

  # TODO: Write general description for PURCHASE
  PURCHASE = 'PURCHASE'.freeze,

  # TODO: Write general description for WITHDRAWAL
  WITHDRAWAL = 'WITHDRAWAL'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ADJUSTMENT) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/fdx_v660_api/models/line_of_credit_transaction_type.rb', line 43

def self.from_value(value, default_value = ADJUSTMENT)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'adjustment' then ADJUSTMENT
  when 'check' then CHECK
  when 'fee' then FEE
  when 'interest' then INTEREST
  when 'payment' then PAYMENT
  when 'purchase' then PURCHASE
  when 'withdrawal' then WITHDRAWAL
  else
    default_value
  end
end

.validate(value) ⇒ Object



37
38
39
40
41
# File 'lib/fdx_v660_api/models/line_of_credit_transaction_type.rb', line 37

def self.validate(value)
  return false if value.nil?

  true
end