Class: ThePlaidApi::BankIncomeCompleteResult

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

Overview

The result of the bank income report generation ‘SUCCESS`: The bank income report was successfully generated and can be retrieved via `/credit/bank_income/get`. `FAILURE`: The bank income report failed to be generated

Constant Summary collapse

BANK_INCOME_COMPLETE_RESULT =
[
  # TODO: Write general description for SUCCESS
  SUCCESS = 'SUCCESS'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = SUCCESS) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'success' then SUCCESS
  when 'failure' then FAILURE
  else
    default_value
  end
end

.validate(value) ⇒ Object



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

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

  BANK_INCOME_COMPLETE_RESULT.include?(value)
end