Class: ThePlaidApi::CraPdfAddOns

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

Overview

A list of add-ons that can be included in the PDF. ‘cra_income_insights`: Include Income Insights report in the PDF. `cra_partner_insights`: Include Partner Insights report in the PDF.

Constant Summary collapse

CRA_PDF_ADD_ONS =
[
  # TODO: Write general description for CRA_INCOME_INSIGHTS
  CRA_INCOME_INSIGHTS = 'cra_income_insights'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = CRA_INCOME_INSIGHTS) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'cra_income_insights' then CRA_INCOME_INSIGHTS
  when 'cra_partner_insights' then CRA_PARTNER_INSIGHTS
  else
    default_value
  end
end

.validate(value) ⇒ Object



19
20
21
22
23
# File 'lib/the_plaid_api/models/cra_pdf_add_ons.rb', line 19

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

  CRA_PDF_ADD_ONS.include?(value)
end