Class: FdxV660Api::PayoutMode

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

Overview

Frequency of annuity payments. | Value | Description | |-----|-----| | ANNUALLY | Paid Annually | | BIWEEKLY | Paid Bi-weekly | | DAILY | Paid Daily | | MONTHLY | Paid Monthly | | SEMIANNUALLY | Paid Semi-annually | | SEMIMONTHLY | Paid Semi-monthly |

Constant Summary collapse

PAYOUT_MODE =
[
  # TODO: Write general description for ANNUALLY
  ANNUALLY = 'ANNUALLY'.freeze,

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

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

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

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

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ANNUALLY) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'annually' then ANNUALLY
  when 'biweekly' then BIWEEKLY
  when 'daily' then DAILY
  when 'monthly' then MONTHLY
  when 'semiannually' then SEMIANNUALLY
  when 'semimonthly' then SEMIMONTHLY
  when 'weekly' then WEEKLY
  else
    default_value
  end
end

.validate(value) ⇒ Object



35
36
37
38
39
# File 'lib/fdx_v660_api/models/payout_mode.rb', line 35

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

  true
end