Class: ModernTreasury::AccountsType
- Inherits:
-
Object
- Object
- ModernTreasury::AccountsType
- Defined in:
- lib/modern_treasury/models/accounts_type.rb
Overview
accounts_type.
Constant Summary collapse
- ACCOUNTS_TYPE =
[ # TODO: Write general description for EXTERNAL_ACCOUNTS EXTERNAL_ACCOUNTS = 'external_accounts'.freeze, # TODO: Write general description for INTERNAL_ACCOUNTS INTERNAL_ACCOUNTS = 'internal_accounts'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = EXTERNAL_ACCOUNTS) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/modern_treasury/models/accounts_type.rb', line 23 def self.from_value(value, default_value = EXTERNAL_ACCOUNTS) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'external_accounts' then EXTERNAL_ACCOUNTS when 'internal_accounts' then INTERNAL_ACCOUNTS else default_value end end |
.validate(value) ⇒ Object
17 18 19 20 21 |
# File 'lib/modern_treasury/models/accounts_type.rb', line 17 def self.validate(value) return false if value.nil? ACCOUNTS_TYPE.include?(value) end |