Sha256: 59865ec69767262259a8c76dda2f427414bfbb66788458a9e67cbe498bd5363c

Contents?: true

Size: 1.19 KB

Versions: 2

Compression:

Stored size: 1.19 KB

Contents

module ConsolidatedScreeningList
  class Source
    SOURCES = {
      "CAP" => "Correspondent Account or Payable-Through Account Sanctions (CAPTA)",
      "DPL" => "Denied Persons List",
      "DTC" => "ITAR Debarred",
      "EL" => "Entity List",
      "FSE" => "Foreign Sanctions Evaders",
      "ISN" => "Nonproliferation Sanctions",
      "PIB" => "Persons Identified as Blocked",
      "PLC" => "Palestinian Legislative Council List",
      "SDN" => "Specially Designated Nationals",
      "SSI" => "Sectoral Sanctions Identifications List",
      "UVL" => "Unverified List",
      "561" => "Part 561 List",
    }.freeze

    class << self
      def all
        @all ||= SOURCES.map { |key, value| new(key) }
      end

      def find_by_key(key)
        all.find { |source| source.key == key }
      end
      alias [] find_by_key

      def find_by_name(name)
        all.find { |source| source.name == name }
      end

      def keys
        @keys ||= SOURCES.keys
      end
    end

    attr_reader :key

    def initialize(key)
      @key = key
    end

    def inspect
      "#<ConsolidatedScreeningList::Source key=\"#{key}\" name=\"#{name}\">"
    end

    def name
      SOURCES[key]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
consolidated_screening_list-0.0.2 lib/consolidated_screening_list/source.rb
consolidated_screening_list-0.0.1 lib/consolidated_screening_list/source.rb