Class: FdxV660Api::TransferOutUseCase

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

Overview

Use case for which outgoing transfers from an account are supported

Constant Summary collapse

TRANSFER_OUT_USE_CASE =
[
  # TODO: Write general description for MORTGAGE_PAYMENT
  MORTGAGE_PAYMENT = 'MORTGAGE_PAYMENT'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = MORTGAGE_PAYMENT) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/fdx_v660_api/models/transfer_out_use_case.rb', line 23

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

  str = value.to_s.strip

  case str.downcase
  when 'mortgage_payment' then MORTGAGE_PAYMENT
  when 'rent_payment' then RENT_PAYMENT
  else
    default_value
  end
end

.validate(value) ⇒ Object



17
18
19
20
21
# File 'lib/fdx_v660_api/models/transfer_out_use_case.rb', line 17

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

  true
end