Class: ModernTreasury::Subtype
- Inherits:
-
Object
- Object
- ModernTreasury::Subtype
- Defined in:
- lib/modern_treasury/models/subtype.rb
Overview
An additional layer of classification for the type of payment order you are doing. This field is only used for ‘ach` payment orders currently. For `ach`
payment orders, the `subtype` represents the SEC code. We currently
support ‘CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
Constant Summary collapse
- SUBTYPE =
[ # TODO: Write general description for ENUM_0C ENUM_0C = '0C'.freeze, # TODO: Write general description for ENUM_0N ENUM_0N = '0N'.freeze, # TODO: Write general description for ENUM_0S ENUM_0S = '0S'.freeze, # TODO: Write general description for CCD CCD = 'CCD'.freeze, # TODO: Write general description for CIE CIE = 'CIE'.freeze, # TODO: Write general description for CTX CTX = 'CTX'.freeze, # TODO: Write general description for IAT IAT = 'IAT'.freeze, # TODO: Write general description for PPD PPD = 'PPD'.freeze, # TODO: Write general description for TEL TEL = 'TEL'.freeze, # TODO: Write general description for WEB WEB = 'WEB'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = ENUM_0C) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/modern_treasury/models/subtype.rb', line 50 def self.from_value(value, default_value = ENUM_0C) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'enum_0c' then ENUM_0C when 'enum_0n' then ENUM_0N when 'enum_0s' then ENUM_0S when 'ccd' then CCD when 'cie' then CIE when 'ctx' then CTX when 'iat' then IAT when 'ppd' then PPD when 'tel' then TEL when 'web' then WEB else default_value end end |
.validate(value) ⇒ Object
44 45 46 47 48 |
# File 'lib/modern_treasury/models/subtype.rb', line 44 def self.validate(value) return false if value.nil? SUBTYPE.include?(value) end |