Class: ThePlaidApi::UserStatedIncomeSourceFrequency
- Inherits:
-
Object
- Object
- ThePlaidApi::UserStatedIncomeSourceFrequency
- Defined in:
- lib/the_plaid_api/models/user_stated_income_source_frequency.rb
Overview
The pay frequency of a specified income source
Constant Summary collapse
- USER_STATED_INCOME_SOURCE_FREQUENCY =
[ # TODO: Write general description for UNKNOWN UNKNOWN = 'UNKNOWN'.freeze, # TODO: Write general description for WEEKLY WEEKLY = 'WEEKLY'.freeze, # TODO: Write general description for BIWEEKLY BIWEEKLY = 'BIWEEKLY'.freeze, # TODO: Write general description for SEMI_MONTHLY SEMI_MONTHLY = 'SEMI_MONTHLY'.freeze, # TODO: Write general description for MONTHLY MONTHLY = 'MONTHLY'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = UNKNOWN) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/the_plaid_api/models/user_stated_income_source_frequency.rb', line 32 def self.from_value(value, default_value = UNKNOWN) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'unknown' then UNKNOWN when 'weekly' then WEEKLY when 'biweekly' then BIWEEKLY when 'semi_monthly' then SEMI_MONTHLY when 'monthly' then MONTHLY else default_value end end |
.validate(value) ⇒ Object
26 27 28 29 30 |
# File 'lib/the_plaid_api/models/user_stated_income_source_frequency.rb', line 26 def self.validate(value) return false if value.nil? USER_STATED_INCOME_SOURCE_FREQUENCY.include?(value) end |