Sha256: 65ce8c29ef171a00f33f91ef8eadf1c80a7143d64267f2e6533211ca0d3b80b8

Contents?: true

Size: 968 Bytes

Versions: 3

Compression:

Stored size: 968 Bytes

Contents

require 'httparty'
require 'logger'
require "fdic/version"
require 'fdic/client'
require 'fdic/record'
require 'fdic/bank'
require 'fdic/institution'
require 'fdic/branch'
require 'fdic/history_event'

module FDIC

  def find_bank(bank_name)
    resp = Client.new.find_bank(bank_name)
    resp['d']['results'].map { |result|
      FDIC::Bank.new(result)
    }
  end

  def find_institution(certificate_number)
    resp = Client.new.find_institution(certificate_number)
    result = resp['d']['results'].first
    FDIC::Institution.new(result)
  end

  def find_branches(certificate_number)
    resp = Client.new.find_branches(certificate_number)
    resp['d']['results'].map { |result|
      FDIC::Branch.new(result)
    }
  end

  def find_history_events(bank_name, certificate_number)
    resp = Client.new.find_history_events(bank_name, certificate_number)
    resp['d']['results'].map { |result|
      FDIC::HistoryEvent.new(result)
    }
  end

  extend self
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fdic-0.3.0 lib/fdic.rb
fdic-0.2.0 lib/fdic.rb
fdic-0.1.0 lib/fdic.rb