Class: ThePlaidApi::CashflowAttributesVersion

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

Overview

The version of cashflow attributes. Required if using Cash Flow Insights.

Constant Summary collapse

CASHFLOW_ATTRIBUTES_VERSION =
[
  # TODO: Write general description for ENUM_V10
  ENUM_V10 = 'v1.0'.freeze,

  # TODO: Write general description for ENUM_V20
  ENUM_V20 = 'v2.0'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ENUM_V10) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'enum_v10' then ENUM_V10
  when 'enum_v20' then ENUM_V20
  when 'cfi1' then CFI1
  else
    default_value
  end
end

.validate(value) ⇒ Object



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

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

  CASHFLOW_ATTRIBUTES_VERSION.include?(value)
end