Class: FdxV660Api::InsuranceTransactionType

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

Overview

The type of an insurance transaction

Constant Summary collapse

INSURANCE_TRANSACTION_TYPE =
[
  # TODO: Write general description for ADJUSTMENT
  ADJUSTMENT = 'ADJUSTMENT'.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
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ADJUSTMENT) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/fdx_v660_api/models/insurance_transaction_type.rb', line 29

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 'fee' then FEE
  when 'interest' then INTEREST
  when 'payment' then PAYMENT
  else
    default_value
  end
end

.validate(value) ⇒ Object



23
24
25
26
27
# File 'lib/fdx_v660_api/models/insurance_transaction_type.rb', line 23

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

  true
end