class FrbParticipants::Participant

Public Class Methods

data() click to toggle source
# File lib/frb-participants/models/participant.rb, line 16
def self.data
  @@participant_data ||= fedwire_data.merge(fedach_data)
end
fedach_data() click to toggle source
# File lib/frb-participants/models/participant.rb, line 24
def self.fedach_data
  @@fedach_data ||= FrbParticipants::Data.load("fedach-participants.yml")
end
fedwire_data() click to toggle source
# File lib/frb-participants/models/participant.rb, line 20
def self.fedwire_data
  @@fedwire_data ||= FrbParticipants::Data.load("fedwire-participants.yml")
end
find_by_routing_number(routing_number) click to toggle source
# File lib/frb-participants/models/participant.rb, line 3
def self.find_by_routing_number(routing_number)
  participant_attributes = data[routing_number]
  if participant_attributes
    type = participant_attributes.has_key?(:settlement_only) ? :wire : :ach
    institution_name = FrbParticipants::InstitutionName.find_by_frb_name(participant_attributes[:customer_name])
    OpenStruct.new(participant_attributes.merge(
      type: type,
      known_normalized_name: institution_name.known_normalized_name,
      best_attempt_normalized_name: institution_name.best_attempt_normalized_name,
    ))
  end
end