Class: ThePlaidApi::CraBankIncomeStatus

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

Overview

The status of the income sources. ‘ACTIVE`: The income source is active. `INACTIVE`: The income source is inactive. `UNKNOWN`: The income source status is unknown.

Constant Summary collapse

CRA_BANK_INCOME_STATUS =
[
  # TODO: Write general description for ACTIVE
  ACTIVE = 'ACTIVE'.freeze,

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ACTIVE) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/the_plaid_api/models/cra_bank_income_status.rb', line 28

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

  str = value.to_s.strip

  case str.downcase
  when 'active' then ACTIVE
  when 'inactive' then INACTIVE
  when 'unknown' then UNKNOWN
  else
    default_value
  end
end

.validate(value) ⇒ Object



22
23
24
25
26
# File 'lib/the_plaid_api/models/cra_bank_income_status.rb', line 22

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

  CRA_BANK_INCOME_STATUS.include?(value)
end