Class: ThePlaidApi::AssetRetirementIndicator

Inherits:
Object
  • Object
show all
Defined in:
lib/the_plaid_api/models/asset_retirement_indicator.rb

Overview

Whether or not the account is a retirement account (e.g., 401K, 403b, 457, thrift savings plans, traditional and Roth, IRAs, SEP-IRA, SIMPLE-IRA, KEOGH, state retirement savings plans, other independent and IRS-qualified employer retirement plans)

Constant Summary collapse

ASSET_RETIREMENT_INDICATOR =
[
  # TODO: Write general description for ENUM_TRUE
  ENUM_TRUE = 'true'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ENUM_TRUE) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/the_plaid_api/models/asset_retirement_indicator.rb', line 26

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

  str = value.to_s.strip

  case str.downcase
  when 'enum_true' then ENUM_TRUE
  when 'enum_false' then ENUM_FALSE
  else
    default_value
  end
end

.validate(value) ⇒ Object



20
21
22
23
24
# File 'lib/the_plaid_api/models/asset_retirement_indicator.rb', line 20

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

  ASSET_RETIREMENT_INDICATOR.include?(value)
end