Class: ModernTreasury::OriginatingAccountNumberType
- Inherits:
-
Object
- Object
- ModernTreasury::OriginatingAccountNumberType
- Defined in:
- lib/modern_treasury/models/originating_account_number_type.rb
Overview
The type of the originating account number for the incoming payment detail.
Constant Summary collapse
- ORIGINATING_ACCOUNT_NUMBER_TYPE =
[ # TODO: Write general description for CLABE CLABE = 'clabe'.freeze, # TODO: Write general description for IBAN IBAN = 'iban'.freeze, # TODO: Write general description for OTHER OTHER = 'other'.freeze, # TODO: Write general description for PAN PAN = 'pan'.freeze, # TODO: Write general description for WALLET_ADDRESS WALLET_ADDRESS = 'wallet_address'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = CLABE) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/modern_treasury/models/originating_account_number_type.rb', line 32 def self.from_value(value, default_value = CLABE) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'clabe' then CLABE when 'iban' then IBAN when 'other' then OTHER when 'pan' then PAN when 'wallet_address' then WALLET_ADDRESS else default_value end end |
.validate(value) ⇒ Object
26 27 28 29 30 |
# File 'lib/modern_treasury/models/originating_account_number_type.rb', line 26 def self.validate(value) return false if value.nil? ORIGINATING_ACCOUNT_NUMBER_TYPE.include?(value) end |