Class: Plaid::Value
- Inherits:
-
Object
- Object
- Plaid::Value
- Defined in:
- lib/plaid/models/value.rb
Overview
The frequency of the pay period.
Constant Summary collapse
- VALUE =
[ # TODO: Write general description for MONTHLY MONTHLY = 'monthly'.freeze, # TODO: Write general description for SEMIMONTHLY SEMIMONTHLY = 'semimonthly'.freeze, # TODO: Write general description for WEEKLY WEEKLY = 'weekly'.freeze, # TODO: Write general description for BIWEEKLY BIWEEKLY = 'biweekly'.freeze, # TODO: Write general description for UNKNOWN UNKNOWN = 'unknown'.freeze, # TODO: Write general description for NULL NULL = 'null'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = MONTHLY) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/plaid/models/value.rb', line 35 def self.from_value(value, default_value = MONTHLY) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'monthly' then MONTHLY when 'semimonthly' then SEMIMONTHLY when 'weekly' then WEEKLY when 'biweekly' then BIWEEKLY when 'unknown' then UNKNOWN when 'null' then NULL else default_value end end |
.validate(value) ⇒ Object
29 30 31 32 33 |
# File 'lib/plaid/models/value.rb', line 29 def self.validate(value) return false if value.nil? true end |