Class: ThePlaidApi::CreditPayStubPayBasisType

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

Overview

The explicit pay basis on the paystub (if present).

Constant Summary collapse

CREDIT_PAY_STUB_PAY_BASIS_TYPE =
[
  # TODO: Write general description for SALARY
  SALARY = 'SALARY'.freeze,

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = SALARY) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'salary' then SALARY
  when 'hourly' then HOURLY
  when 'commission' then COMMISSION
  else
    default_value
  end
end

.validate(value) ⇒ Object



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

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

  CREDIT_PAY_STUB_PAY_BASIS_TYPE.include?(value)
end