Class: UnivapayClientSdk::DirectDebitBankAccountType

Inherits:
Object
  • Object
show all
Defined in:
lib/univapay_client_sdk/models/direct_debit_bank_account_type.rb

Overview

Deposit account type (預金種類) — regular (普通), current (当座), savings (貯蓄) or others (その他).

Constant Summary collapse

DIRECT_DEBIT_BANK_ACCOUNT_TYPE =
[
  # TODO: Write general description for REGULAR
  REGULAR = 'regular'.freeze,

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

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = REGULAR) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account_type.rb', line 30

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

  str = value.to_s.strip

  case str.downcase
  when 'regular' then REGULAR
  when 'current' then CURRENT
  when 'savings' then SAVINGS
  when 'others' then OTHERS
  else
    default_value
  end
end

.validate(value) ⇒ Object



24
25
26
27
28
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account_type.rb', line 24

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

  DIRECT_DEBIT_BANK_ACCOUNT_TYPE.include?(value)
end