Class: FdxV660Api::EventFrequency

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

Overview

Defines how often an event occurs in a series such as a sequence of payments. Actual payment processing or other event date may be moved by processor to precede or succeed the specified date so it doesn't land on a weekend or holiday * ONETIME: A single, one-time payment or event on scheduled date * DAILY: A payment or event every single day * WEEKLY: Payment or event every 7 days * BIWEEKLY: Payment or event every 14 days * SEMIMONTHLY: Payment or event every 15 days, same as TWICEMONTHLY, deprecated and will be removed in next major release * TWICEMONTHLY: Payment or event every 15 days, often on 15th and last day of month, same as SEMIMONTHLY * FOURWEEKS: Payment or event every 28 days * DUEDATE: Payment on the actual obligation due date when scheduled with Payee, often monthly, on correct date even if it moves around to avoid weekends or holidays * MONTHLY: Payment or event monthly on the same date each month * BIMONTHLY: Payment or event every other month on the same day of the month * QUARTERLY: Payment or event every third month on the same day of the month * SEMIANNUALLY: Payment or event every six months on the same day of the month * ANNUALLY: Payment or event every year on the same date * OTHER: Payment or event on another frequency schedule not included in this list

Constant Summary collapse

EVENT_FREQUENCY =
[
  # TODO: Write general description for ONETIME
  ONETIME = 'ONETIME'.freeze,

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

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

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

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

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

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

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

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

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

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

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

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ONETIME) ⇒ Object



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/fdx_v660_api/models/event_frequency.rb', line 77

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

  str = value.to_s.strip

  case str.downcase
  when 'onetime' then ONETIME
  when 'daily' then DAILY
  when 'weekly' then WEEKLY
  when 'biweekly' then BIWEEKLY
  when 'semimonthly' then SEMIMONTHLY
  when 'twicemonthly' then TWICEMONTHLY
  when 'fourweeks' then FOURWEEKS
  when 'duedate' then DUEDATE
  when 'monthly' then MONTHLY
  when 'bimonthly' then BIMONTHLY
  when 'quarterly' then QUARTERLY
  when 'semiannually' then SEMIANNUALLY
  when 'annually' then ANNUALLY
  when 'other' then OTHER
  else
    default_value
  end
end

.validate(value) ⇒ Object



71
72
73
74
75
# File 'lib/fdx_v660_api/models/event_frequency.rb', line 71

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

  true
end