Class: ThePlaidApi::PartyRegistry
- Inherits:
-
Object
- Object
- ThePlaidApi::PartyRegistry
- Defined in:
- lib/the_plaid_api/models/party_registry.rb
Overview
The registry containing the party’s registration with name and id
Constant Summary collapse
- PARTY_REGISTRY =
[ # TODO: Write general description for FDX FDX = 'FDX'.freeze, # TODO: Write general description for GLEIF GLEIF = 'GLEIF'.freeze, # TODO: Write general description for ICANN ICANN = 'ICANN'.freeze, # TODO: Write general description for PRIVATE PRIVATE = 'PRIVATE'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = FDX) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/the_plaid_api/models/party_registry.rb', line 29 def self.from_value(value, default_value = FDX) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'fdx' then FDX when 'gleif' then GLEIF when 'icann' then ICANN when 'private' then PRIVATE else default_value end end |
.validate(value) ⇒ Object
23 24 25 26 27 |
# File 'lib/the_plaid_api/models/party_registry.rb', line 23 def self.validate(value) return false if value.nil? PARTY_REGISTRY.include?(value) end |